aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2004-01-26 23:39:08 +0000
committerJan Djärv2004-01-26 23:39:08 +0000
commitca4981285f6aa4883c44f0ac857aaca686241669 (patch)
tree89c6a66b43cdb44702d2f26dcbd2dc375e98955a /src
parent6497a8f888d17ff230428fa802a6b5685c542280 (diff)
downloademacs-ca4981285f6aa4883c44f0ac857aaca686241669.tar.gz
emacs-ca4981285f6aa4883c44f0ac857aaca686241669.zip
Define synch_process_termsig.
(Fcall_process): Initiate synch_process_termsig to zero and check if non-zero and get signal name after subprocess has ended.
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 00068a908fb..73d81d81b18 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -123,6 +123,9 @@ int synch_process_alive;
123/* Nonzero => this is a string explaining death of synchronous subprocess. */ 123/* Nonzero => this is a string explaining death of synchronous subprocess. */
124char *synch_process_death; 124char *synch_process_death;
125 125
126/* Nonzero => this is the signal number that terminated the subprocess. */
127int synch_process_termsig;
128
126/* If synch_process_death is zero, 129/* If synch_process_death is zero,
127 this is exit code of synchronous subprocess. */ 130 this is exit code of synchronous subprocess. */
128int synch_process_retcode; 131int synch_process_retcode;
@@ -506,6 +509,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
506 to avoid timing error if process terminates soon. */ 509 to avoid timing error if process terminates soon. */
507 synch_process_death = 0; 510 synch_process_death = 0;
508 synch_process_retcode = 0; 511 synch_process_retcode = 0;
512 synch_process_termsig = 0;
509 513
510 if (NILP (error_file)) 514 if (NILP (error_file))
511 fd_error = emacs_open (NULL_DEVICE, O_WRONLY, 0); 515 fd_error = emacs_open (NULL_DEVICE, O_WRONLY, 0);
@@ -977,6 +981,19 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
977 981
978 unbind_to (count, Qnil); 982 unbind_to (count, Qnil);
979 983
984 if (synch_process_termsig)
985 {
986 char *signame;
987
988 synchronize_system_messages_locale ();
989 signame = strsignal (synch_process_termsig);
990
991 if (signame == 0)
992 signame = "unknown";
993
994 synch_process_death = signame;
995 }
996
980 if (synch_process_death) 997 if (synch_process_death)
981 return code_convert_string_norecord (build_string (synch_process_death), 998 return code_convert_string_norecord (build_string (synch_process_death),
982 Vlocale_coding_system, 0); 999 Vlocale_coding_system, 0);