From 604efe86a9fa5ab29cb701136b4a2dac1526062a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Mar 2011 15:36:12 -0700 Subject: * sysdep.c (reset_io): Now static. --- src/sysdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sysdep.c') diff --git a/src/sysdep.c b/src/sysdep.c index 5760d0224eb..ac7927e8734 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -632,7 +632,7 @@ init_sigio (int fd) { } -void +static void reset_sigio (int fd) { } @@ -662,7 +662,7 @@ init_sigio (int fd) interrupts_deferred = 0; } -void +static void reset_sigio (int fd) { #ifdef FASYNC -- cgit v1.2.1 From b8950c9480bca68fd8c7a619127cb69c9aa684fe Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Mar 2011 15:37:08 -0700 Subject: * sysdep.c (wait_for_termination_signal): Remove; unused. --- src/sysdep.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/sysdep.c') diff --git a/src/sysdep.c b/src/sysdep.c index ac7927e8734..e5bf27f4fec 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -292,10 +292,6 @@ init_baud_rate (int fd) int wait_debugging; /* Set nonzero to make following function work under dbx (at least for bsd). */ -SIGTYPE -wait_for_termination_signal (void) -{} - #ifndef MSDOS /* Wait for subprocess with process id `pid' to terminate and make sure it will get eliminated (not remain forever as a zombie) */ -- cgit v1.2.1 From a70072c9a5be8a9cdd4d848b30ee5c82ee5c0987 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Mar 2011 15:52:28 -0700 Subject: * sysdep.c (system_process_attributes): Rename vars to avoid shadowing. --- src/sysdep.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/sysdep.c') 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; -- cgit v1.2.1 From fbd02d7b061d3adc47ccce6ff568ef4bd3aecf17 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Mar 2011 15:56:24 -0700 Subject: * sysdep.c: Fix pointer signedness issue. --- src/sysdep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/sysdep.c') diff --git a/src/sysdep.c b/src/sysdep.c index b8fbf863074..e19f9ca829e 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2845,8 +2845,10 @@ system_process_attributes (Lisp_Object pid) fd = emacs_open (fn, O_RDONLY, 0); if (fd >= 0) { - for (cmdline_size = 0; emacs_read (fd, &c, 1) == 1; cmdline_size++) + char ch; + for (cmdline_size = 0; emacs_read (fd, &ch, 1) == 1; cmdline_size++) { + c = ch; if (isspace (c) || c == '\\') cmdline_size++; /* for later quoting, see below */ } -- cgit v1.2.1 From edced198e35ccd2ab81797988705597da3fc3e19 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Mar 2011 16:30:06 -0700 Subject: * sysdep.c (sys_subshell): Mark local as volatile if checking for lint, to suppress a gcc -Wclobbered warning that does not seem to be right. --- src/sysdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sysdep.c') diff --git a/src/sysdep.c b/src/sysdep.c index e19f9ca829e..1c49b2a3387 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -488,7 +488,7 @@ sys_subshell (void) int pid; struct save_signal saved_handlers[5]; Lisp_Object dir; - unsigned char *str = 0; + unsigned char * IF_LINT (volatile) str = 0; int len; saved_handlers[0].code = SIGINT; -- cgit v1.2.1 From 15dfd3d9d66e43270f6ba506a7333bdc409a1ea9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Mar 2011 16:31:21 -0700 Subject: * sysdep.c (MAXPATHLEN): Define only if needed. --- src/sysdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sysdep.c') diff --git a/src/sysdep.c b/src/sysdep.c index 1c49b2a3387..6ef3d88c5c8 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1886,13 +1886,13 @@ emacs_write (int fildes, const char *buf, unsigned int nbyte) * under error conditions. */ +#ifndef HAVE_GETWD + #ifndef MAXPATHLEN /* In 4.1, param.h fails to define this. */ #define MAXPATHLEN 1024 #endif -#ifndef HAVE_GETWD - char * getwd (char *pathname) { -- cgit v1.2.1