--- emacs-18.59-orig/src/ChangeLog +++ emacs-18.59/src/ChangeLog @@ -1,3 +1,11 @@ +2015-12-19 Ulrich Mueller + + Fix a couple of compiler warnings. + * buffer.c (init_buffer): Use getcwd(3) instead of getwd(3). + * callproc.c (Fcall_process): Check for errors of pipe(2). + (child_setup): Check for errors of chdir(2). + * process.c (sigchld_handler): Add type cast. + 2012-06-28 Ulrich Mueller Support x32 ABI on x86_64 architecture. --- emacs-18.59-orig/src/buffer.c +++ emacs-18.59/src/buffer.c @@ -1131,8 +1131,8 @@ char buf[MAXPATHLEN+1]; Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); - if (getwd (buf) == 0) - fatal ("`getwd' failed: %s.\n", buf); + if (getcwd (buf, MAXPATHLEN+1) == 0) + fatal ("`getcwd' failed: %s.\n", buf); #ifndef VMS /* Maybe this should really use some standard subroutine --- emacs-18.59-orig/src/callproc.c +++ emacs-18.59/src/callproc.c @@ -184,7 +184,10 @@ #endif /* not VMS */ else { - pipe (fd); + if (pipe (fd) < 0) { + close (filefd); + report_file_error ("Creating pipe", Qnil); + } #if 0 /* Replaced by close_process_descs */ set_exclusive_use (fd[0]); @@ -362,7 +365,8 @@ bcopy (XSTRING (current_buffer->directory)->data, temp, i); if (temp[i - 1] != '/') temp[i++] = '/'; temp[i] = 0; - chdir (temp); + if (chdir (temp) < 0) + _exit (1); } #ifndef MAINTAIN_ENVIRONMENT --- emacs-18.59-orig/src/process.c +++ emacs-18.59/src/process.c @@ -2517,7 +2517,7 @@ if (WIFEXITED (w)) synch_process_retcode = WRETCODE (w); else if (WIFSIGNALED (w)) - synch_process_death = sys_siglist[WTERMSIG (w)]; + synch_process_death = (char *) sys_siglist[WTERMSIG (w)]; } /* On some systems, we must return right away. --- emacs-18.59-orig/etc/ChangeLog +++ emacs-18.59/etc/ChangeLog @@ -1,3 +1,7 @@ +2015-12-19 Ulrich Mueller + + * etags.c (main): Check for errors of system(3). + 2012-06-28 Ulrich Mueller * fakemail.c (make_file_preface): time(2) returns a value of --- emacs-18.59-orig/etc/etags.c +++ emacs-18.59/etc/etags.c @@ -342,7 +342,8 @@ sprintf(cmd, "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS", outfile, av[i], outfile); - system(cmd); + if (system(cmd) != 0) + fatal ("%s", "failed to execute shell command"); } aflag++; } @@ -359,7 +360,8 @@ if (uflag) { sprintf(cmd, "sort %s -o %s", outfile, outfile); - system(cmd); + if (system(cmd) != 0) + fatal ("%s", "failed to execute shell command"); } #endif exit(GOOD);