X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fprocess-unix.c;h=8220dcc58e5756cfdc0dfdacf96a64bfd88a8db4;hp=a0b6b740690bf68029027870584a9d6abb2fc8d1;hb=fc475e6669a613cd6d98eb5511c749a23b63c7ac;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910 diff --git a/src/process-unix.c b/src/process-unix.c index a0b6b74..8220dcc 100644 --- a/src/process-unix.c +++ b/src/process-unix.c @@ -735,7 +735,7 @@ unix_create_process (struct Lisp_Process *p, /* Nothing below here GCs so our string pointers shouldn't move. */ new_argv = alloca_array (char *, nargv + 2); - new_argv[0] = (char *) XSTRING_DATA (program); + GET_C_STRING_FILENAME_DATA_ALLOCA (program, new_argv[0]); for (i = 0; i < nargv; i++) { Lisp_Object tem = argv[i]; @@ -743,7 +743,7 @@ unix_create_process (struct Lisp_Process *p, new_argv[i + 1] = (char *) XSTRING_DATA (tem); } new_argv[i + 1] = 0; - current_dir = (char *) XSTRING_DATA (cur_dir); + GET_C_STRING_FILENAME_DATA_ALLOCA (cur_dir, current_dir); #ifdef HAVE_PTYS if (!NILP (Vprocess_connection_type)) @@ -920,12 +920,14 @@ unix_create_process (struct Lisp_Process *p, EMACS_SET_TTY_PROCESS_GROUP (xforkin, &piddly); } -# ifdef AIX /* On AIX, we've disabled SIGHUP above once we start a child on a pty. Now reenable it in the child, so it - will die when we want it to. */ + will die when we want it to. + JV: This needs to be done ALWAYS as we might have inherited + a SIG_IGN handling from our parent (nohup) and we are in new + process group. + */ signal (SIGHUP, SIG_DFL); -# endif /* AIX */ } #endif /* HAVE_PTYS */ @@ -1196,6 +1198,10 @@ unix_send_process (Lisp_Object proc, struct lstream* lstream) else { /* We got here from a longjmp() from the SIGPIPE handler */ signal (SIGPIPE, old_sigpipe); + /* Close the file lstream so we don't attempt to write to it further */ + /* #### There is controversy over whether this might cause fd leakage */ + /* my tests say no. -slb */ + XLSTREAM (p->pipe_outstream)->flags &= ~LSTREAM_FL_IS_OPEN; p->status_symbol = Qexit; p->exit_code = 256; /* #### SIGPIPE ??? */ p->core_dumped = 0;