From a70072c9a5be8a9cdd4d848b30ee5c82ee5c0987 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Mar 2011 15:52:28 -0700 Subject: [PATCH] * sysdep.c (system_process_attributes): Rename vars to avoid shadowing. --- src/ChangeLog | 2 ++ src/sysdep.c | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index edc79329a3b..0840e5ec9f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-03-14 Paul Eggert + * sysdep.c (system_process_attributes): Rename vars to avoid shadowing. + * process.c (serial_open, serial_configure): Move decls from here ... * systty.h: ... to here, so that they can be checked. diff --git a/src/sysdep.c b/src/sysdep.c index e5bf27f4fec..b8fbf863074 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2667,8 +2667,8 @@ system_process_attributes (Lisp_Object pid) size_t cmdsize = 0, cmdline_size; unsigned char c; int proc_id, ppid, uid, gid, pgrp, sess, tty, tpgid, thcount; - unsigned long long utime, stime, cutime, cstime, start; - long priority, nice, rss; + unsigned long long u_time, s_time, cutime, cstime, start; + long priority, niceness, rss; unsigned long minflt, majflt, cminflt, cmajflt, vsize; time_t sec; unsigned usec; @@ -2748,8 +2748,8 @@ system_process_attributes (Lisp_Object pid) sscanf (p, "%c %d %d %d %d %d %*u %lu %lu %lu %lu %Lu %Lu %Lu %Lu %ld %ld %d %*d %Lu %lu %ld", &c, &ppid, &pgrp, &sess, &tty, &tpgid, &minflt, &cminflt, &majflt, &cmajflt, - &utime, &stime, &cutime, &cstime, - &priority, &nice, &thcount, &start, &vsize, &rss); + &u_time, &s_time, &cutime, &cstime, + &priority, &niceness, &thcount, &start, &vsize, &rss); { char state_str[2]; @@ -2777,13 +2777,14 @@ system_process_attributes (Lisp_Object pid) if (clocks_per_sec < 0) clocks_per_sec = 100; attrs = Fcons (Fcons (Qutime, - ltime_from_jiffies (utime, clocks_per_sec)), + ltime_from_jiffies (u_time, clocks_per_sec)), attrs); attrs = Fcons (Fcons (Qstime, - ltime_from_jiffies (stime, clocks_per_sec)), + ltime_from_jiffies (s_time, clocks_per_sec)), attrs); attrs = Fcons (Fcons (Qtime, - ltime_from_jiffies (stime+utime, clocks_per_sec)), + ltime_from_jiffies (s_time + u_time, + clocks_per_sec)), attrs); attrs = Fcons (Fcons (Qcutime, ltime_from_jiffies (cutime, clocks_per_sec)), @@ -2795,7 +2796,7 @@ system_process_attributes (Lisp_Object pid) ltime_from_jiffies (cstime+cutime, clocks_per_sec)), attrs); attrs = Fcons (Fcons (Qpri, make_number (priority)), attrs); - attrs = Fcons (Fcons (Qnice, make_number (nice)), attrs); + attrs = Fcons (Fcons (Qnice, make_number (niceness)), attrs); attrs = Fcons (Fcons (Qthcount, make_fixnum_or_float (thcount_eint)), attrs); EMACS_GET_TIME (tnow); get_up_time (&sec, &usec); @@ -2825,7 +2826,7 @@ system_process_attributes (Lisp_Object pid) make_number (EMACS_USECS (telapsed)))), attrs); - time_from_jiffies (utime + stime, clocks_per_sec, &sec, &usec); + time_from_jiffies (u_time + s_time, clocks_per_sec, &sec, &usec); pcpu = (sec + usec / 1000000.0) / (EMACS_SECS (telapsed) + EMACS_USECS (telapsed) / 1000000.0); if (pcpu > 1.0) pcpu = 1.0; -- 2.39.5