comparison src/process.c @ 90737:95d0cdf160ea

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 586-614) - Update from CVS - Update from erc--emacs--22 - Merge from gnus--rel--5.10 - Merge from erc--main--0 - Make byte compiler correctly write circular constants * gnus--rel--5.10 (patch 186-196) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-162
author Miles Bader <miles@gnu.org>
date Fri, 26 Jan 2007 06:16:11 +0000
parents bc10a33dd40b 3d45362f1d38
children dd7c098af727
comparison
equal deleted inserted replaced
90736:ef1369583937 90737:95d0cdf160ea
1 /* Asynchronous subprocess control for GNU Emacs. 1 /* Asynchronous subprocess control for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
3 1996, 1998, 1999, 2001, 2002, 2003, 2004, 3 1996, 1998, 1999, 2001, 2002, 2003, 2004,
4 2005, 2006 Free Software Foundation, Inc. 4 2005, 2006, 2007 Free Software Foundation, Inc.
5 5
6 This file is part of GNU Emacs. 6 This file is part of GNU Emacs.
7 7
8 GNU Emacs is free software; you can redistribute it and/or modify 8 GNU Emacs is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
812 } 812 }
813 else if (XINT (p->infd) >= 0) 813 else if (XINT (p->infd) >= 0)
814 { 814 {
815 #ifdef SIGCHLD 815 #ifdef SIGCHLD
816 Lisp_Object symbol; 816 Lisp_Object symbol;
817 /* Assignment to EMACS_INT stops GCC whining about limited range
818 of data type. */
819 EMACS_INT pid = p->pid;;
817 820
818 /* No problem storing the pid here, as it is still in Vprocess_alist. */ 821 /* No problem storing the pid here, as it is still in Vprocess_alist. */
819 deleted_pid_list = Fcons (make_fixnum_or_float (p->pid), 822 deleted_pid_list = Fcons (make_fixnum_or_float (pid),
820 /* GC treated elements set to nil. */ 823 /* GC treated elements set to nil. */
821 Fdelq (Qnil, deleted_pid_list)); 824 Fdelq (Qnil, deleted_pid_list));
822 /* If the process has already signaled, remove it from the list. */ 825 /* If the process has already signaled, remove it from the list. */
823 if (p->raw_status_new) 826 if (p->raw_status_new)
824 update_status (p); 827 update_status (p);
825 symbol = p->status; 828 symbol = p->status;
826 if (CONSP (p->status)) 829 if (CONSP (p->status))
827 symbol = XCAR (p->status); 830 symbol = XCAR (p->status);
828 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) 831 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit))
829 Fdelete (make_fixnum_or_float (p->pid), deleted_pid_list); 832 Fdelete (make_fixnum_or_float (pid), deleted_pid_list);
830 else 833 else
831 #endif 834 #endif
832 { 835 {
833 Fkill_process (process, Qnil); 836 Fkill_process (process, Qnil);
834 /* Do this now, since remove_process will make sigchld_handler do nothing. */ 837 /* Do this now, since remove_process will make sigchld_handler do nothing. */
909 This is the pid of the external process which PROCESS uses or talks to. 912 This is the pid of the external process which PROCESS uses or talks to.
910 For a network connection, this value is nil. */) 913 For a network connection, this value is nil. */)
911 (process) 914 (process)
912 register Lisp_Object process; 915 register Lisp_Object process;
913 { 916 {
917 /* Assignment to EMACS_INT stops GCC whining about limited range of
918 data type. */
919 EMACS_INT pid;
920
914 CHECK_PROCESS (process); 921 CHECK_PROCESS (process);
915 return (XPROCESS (process)->pid 922 pid = XPROCESS (process)->pid;
916 ? make_fixnum_or_float (XPROCESS (process)->pid) 923 return (pid ? make_fixnum_or_float (pid) : Qnil);
917 : Qnil);
918 } 924 }
919 925
920 DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0, 926 DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0,
921 doc: /* Return the name of PROCESS, as a string. 927 doc: /* Return the name of PROCESS, as a string.
922 This is the name of the program invoked in PROCESS, 928 This is the name of the program invoked in PROCESS,
6384 sigheld |= sigbit (SIGCHLD); 6390 sigheld |= sigbit (SIGCHLD);
6385 #endif 6391 #endif
6386 6392
6387 while (1) 6393 while (1)
6388 { 6394 {
6389 register int pid; 6395 register EMACS_INT pid;
6390 WAITTYPE w; 6396 WAITTYPE w;
6391 Lisp_Object tail; 6397 Lisp_Object tail;
6392 6398
6393 #ifdef WNOHANG 6399 #ifdef WNOHANG
6394 #ifndef WUNTRACED 6400 #ifndef WUNTRACED