comparison src/process.c @ 83554:b8d9a391daf3

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-599 Merge from erc--main--0 * emacs@sv.gnu.org/emacs--devo--0--patch-600 Merge from erc--main--0 * emacs@sv.gnu.org/emacs--devo--0--patch-601 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-602 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-603 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-604 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-605 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-606 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-607 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-608 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-609 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-610 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-611 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-612 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-613 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-614 Make byte compiler correctly write circular constants * emacs@sv.gnu.org/emacs--devo--0--patch-615 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-616 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-617 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-618 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-192 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-193 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-194 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-195 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-196 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-594
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 29 Jan 2007 22:21:19 +0000
parents 17e0dd217877 3d45362f1d38
children 07774e5c3ff5
comparison
equal deleted inserted replaced
83553:32073cbc5eb6 83554:b8d9a391daf3
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
813 } 813 }
814 else if (XINT (p->infd) >= 0) 814 else if (XINT (p->infd) >= 0)
815 { 815 {
816 #ifdef SIGCHLD 816 #ifdef SIGCHLD
817 Lisp_Object symbol; 817 Lisp_Object symbol;
818 /* Assignment to EMACS_INT stops GCC whining about limited range
819 of data type. */
820 EMACS_INT pid = p->pid;;
818 821
819 /* No problem storing the pid here, as it is still in Vprocess_alist. */ 822 /* No problem storing the pid here, as it is still in Vprocess_alist. */
820 deleted_pid_list = Fcons (make_fixnum_or_float (p->pid), 823 deleted_pid_list = Fcons (make_fixnum_or_float (pid),
821 /* GC treated elements set to nil. */ 824 /* GC treated elements set to nil. */
822 Fdelq (Qnil, deleted_pid_list)); 825 Fdelq (Qnil, deleted_pid_list));
823 /* If the process has already signaled, remove it from the list. */ 826 /* If the process has already signaled, remove it from the list. */
824 if (p->raw_status_new) 827 if (p->raw_status_new)
825 update_status (p); 828 update_status (p);
826 symbol = p->status; 829 symbol = p->status;
827 if (CONSP (p->status)) 830 if (CONSP (p->status))
828 symbol = XCAR (p->status); 831 symbol = XCAR (p->status);
829 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) 832 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit))
830 Fdelete (make_fixnum_or_float (p->pid), deleted_pid_list); 833 Fdelete (make_fixnum_or_float (pid), deleted_pid_list);
831 else 834 else
832 #endif 835 #endif
833 { 836 {
834 Fkill_process (process, Qnil); 837 Fkill_process (process, Qnil);
835 /* Do this now, since remove_process will make sigchld_handler do nothing. */ 838 /* Do this now, since remove_process will make sigchld_handler do nothing. */
910 This is the pid of the external process which PROCESS uses or talks to. 913 This is the pid of the external process which PROCESS uses or talks to.
911 For a network connection, this value is nil. */) 914 For a network connection, this value is nil. */)
912 (process) 915 (process)
913 register Lisp_Object process; 916 register Lisp_Object process;
914 { 917 {
918 /* Assignment to EMACS_INT stops GCC whining about limited range of
919 data type. */
920 EMACS_INT pid;
921
915 CHECK_PROCESS (process); 922 CHECK_PROCESS (process);
916 return (XPROCESS (process)->pid 923 pid = XPROCESS (process)->pid;
917 ? make_fixnum_or_float (XPROCESS (process)->pid) 924 return (pid ? make_fixnum_or_float (pid) : Qnil);
918 : Qnil);
919 } 925 }
920 926
921 DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0, 927 DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0,
922 doc: /* Return the name of PROCESS, as a string. 928 doc: /* Return the name of PROCESS, as a string.
923 This is the name of the program invoked in PROCESS, 929 This is the name of the program invoked in PROCESS,
6408 sigheld |= sigbit (SIGCHLD); 6414 sigheld |= sigbit (SIGCHLD);
6409 #endif 6415 #endif
6410 6416
6411 while (1) 6417 while (1)
6412 { 6418 {
6413 register int pid; 6419 register EMACS_INT pid;
6414 WAITTYPE w; 6420 WAITTYPE w;
6415 Lisp_Object tail; 6421 Lisp_Object tail;
6416 6422
6417 #ifdef WNOHANG 6423 #ifdef WNOHANG
6418 #ifndef WUNTRACED 6424 #ifndef WUNTRACED