Mercurial > emacs
comparison src/process.c @ 75220:1b003fe28dfe
(Fdelete_process, Fprocess_id, sigchld_handler): Copy PID into EMACS_INT
to avoid GCC warnings.
| author | Eli Zaretskii <eliz@gnu.org> |
|---|---|
| date | Sat, 13 Jan 2007 21:57:35 +0000 |
| parents | 9321ec6bc5db |
| children | 3d45362f1d38 |
comparison
equal
deleted
inserted
replaced
| 75219:8f98728fbb1f | 75220:1b003fe28dfe |
|---|---|
| 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, |
| 6403 sigheld |= sigbit (SIGCHLD); | 6409 sigheld |= sigbit (SIGCHLD); |
| 6404 #endif | 6410 #endif |
| 6405 | 6411 |
| 6406 while (1) | 6412 while (1) |
| 6407 { | 6413 { |
| 6408 register int pid; | 6414 register EMACS_INT pid; |
| 6409 WAITTYPE w; | 6415 WAITTYPE w; |
| 6410 Lisp_Object tail; | 6416 Lisp_Object tail; |
| 6411 | 6417 |
| 6412 #ifdef WNOHANG | 6418 #ifdef WNOHANG |
| 6413 #ifndef WUNTRACED | 6419 #ifndef WUNTRACED |
