diff options
| author | Kim F. Storm | 2005-11-08 21:38:37 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-11-08 21:38:37 +0000 |
| commit | 675984ede6dc0615150ff8fccf65a72f3a4d7876 (patch) | |
| tree | 02f53ebd1463557ce144c265f80f2446cc783017 | |
| parent | a967ed62bb5c69ff1a5c81ef243bfb3c0c673a58 (diff) | |
| download | emacs-675984ede6dc0615150ff8fccf65a72f3a4d7876.tar.gz emacs-675984ede6dc0615150ff8fccf65a72f3a4d7876.zip | |
(Fsignal_process): Recognize signal names with and
without SIG prefix, e.g. SIGHUP and HUP.
| -rw-r--r-- | src/process.c | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/process.c b/src/process.c index 45aeb3f6f35..516e4639c34 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5944,97 +5944,100 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */) | |||
| 5944 | CHECK_SYMBOL (sigcode); | 5944 | CHECK_SYMBOL (sigcode); |
| 5945 | name = SDATA (SYMBOL_NAME (sigcode)); | 5945 | name = SDATA (SYMBOL_NAME (sigcode)); |
| 5946 | 5946 | ||
| 5947 | if (!strncmp(name, "SIG", 3)) | ||
| 5948 | name += 3; | ||
| 5949 | |||
| 5947 | if (0) | 5950 | if (0) |
| 5948 | ; | 5951 | ; |
| 5949 | #ifdef SIGHUP | 5952 | #ifdef SIGHUP |
| 5950 | handle_signal ("SIGHUP", SIGHUP); | 5953 | handle_signal ("HUP", SIGHUP); |
| 5951 | #endif | 5954 | #endif |
| 5952 | #ifdef SIGINT | 5955 | #ifdef SIGINT |
| 5953 | handle_signal ("SIGINT", SIGINT); | 5956 | handle_signal ("INT", SIGINT); |
| 5954 | #endif | 5957 | #endif |
| 5955 | #ifdef SIGQUIT | 5958 | #ifdef SIGQUIT |
| 5956 | handle_signal ("SIGQUIT", SIGQUIT); | 5959 | handle_signal ("QUIT", SIGQUIT); |
| 5957 | #endif | 5960 | #endif |
| 5958 | #ifdef SIGILL | 5961 | #ifdef SIGILL |
| 5959 | handle_signal ("SIGILL", SIGILL); | 5962 | handle_signal ("ILL", SIGILL); |
| 5960 | #endif | 5963 | #endif |
| 5961 | #ifdef SIGABRT | 5964 | #ifdef SIGABRT |
| 5962 | handle_signal ("SIGABRT", SIGABRT); | 5965 | handle_signal ("ABRT", SIGABRT); |
| 5963 | #endif | 5966 | #endif |
| 5964 | #ifdef SIGEMT | 5967 | #ifdef SIGEMT |
| 5965 | handle_signal ("SIGEMT", SIGEMT); | 5968 | handle_signal ("EMT", SIGEMT); |
| 5966 | #endif | 5969 | #endif |
| 5967 | #ifdef SIGKILL | 5970 | #ifdef SIGKILL |
| 5968 | handle_signal ("SIGKILL", SIGKILL); | 5971 | handle_signal ("KILL", SIGKILL); |
| 5969 | #endif | 5972 | #endif |
| 5970 | #ifdef SIGFPE | 5973 | #ifdef SIGFPE |
| 5971 | handle_signal ("SIGFPE", SIGFPE); | 5974 | handle_signal ("FPE", SIGFPE); |
| 5972 | #endif | 5975 | #endif |
| 5973 | #ifdef SIGBUS | 5976 | #ifdef SIGBUS |
| 5974 | handle_signal ("SIGBUS", SIGBUS); | 5977 | handle_signal ("BUS", SIGBUS); |
| 5975 | #endif | 5978 | #endif |
| 5976 | #ifdef SIGSEGV | 5979 | #ifdef SIGSEGV |
| 5977 | handle_signal ("SIGSEGV", SIGSEGV); | 5980 | handle_signal ("SEGV", SIGSEGV); |
| 5978 | #endif | 5981 | #endif |
| 5979 | #ifdef SIGSYS | 5982 | #ifdef SIGSYS |
| 5980 | handle_signal ("SIGSYS", SIGSYS); | 5983 | handle_signal ("SYS", SIGSYS); |
| 5981 | #endif | 5984 | #endif |
| 5982 | #ifdef SIGPIPE | 5985 | #ifdef SIGPIPE |
| 5983 | handle_signal ("SIGPIPE", SIGPIPE); | 5986 | handle_signal ("PIPE", SIGPIPE); |
| 5984 | #endif | 5987 | #endif |
| 5985 | #ifdef SIGALRM | 5988 | #ifdef SIGALRM |
| 5986 | handle_signal ("SIGALRM", SIGALRM); | 5989 | handle_signal ("ALRM", SIGALRM); |
| 5987 | #endif | 5990 | #endif |
| 5988 | #ifdef SIGTERM | 5991 | #ifdef SIGTERM |
| 5989 | handle_signal ("SIGTERM", SIGTERM); | 5992 | handle_signal ("TERM", SIGTERM); |
| 5990 | #endif | 5993 | #endif |
| 5991 | #ifdef SIGURG | 5994 | #ifdef SIGURG |
| 5992 | handle_signal ("SIGURG", SIGURG); | 5995 | handle_signal ("URG", SIGURG); |
| 5993 | #endif | 5996 | #endif |
| 5994 | #ifdef SIGSTOP | 5997 | #ifdef SIGSTOP |
| 5995 | handle_signal ("SIGSTOP", SIGSTOP); | 5998 | handle_signal ("STOP", SIGSTOP); |
| 5996 | #endif | 5999 | #endif |
| 5997 | #ifdef SIGTSTP | 6000 | #ifdef SIGTSTP |
| 5998 | handle_signal ("SIGTSTP", SIGTSTP); | 6001 | handle_signal ("TSTP", SIGTSTP); |
| 5999 | #endif | 6002 | #endif |
| 6000 | #ifdef SIGCONT | 6003 | #ifdef SIGCONT |
| 6001 | handle_signal ("SIGCONT", SIGCONT); | 6004 | handle_signal ("CONT", SIGCONT); |
| 6002 | #endif | 6005 | #endif |
| 6003 | #ifdef SIGCHLD | 6006 | #ifdef SIGCHLD |
| 6004 | handle_signal ("SIGCHLD", SIGCHLD); | 6007 | handle_signal ("CHLD", SIGCHLD); |
| 6005 | #endif | 6008 | #endif |
| 6006 | #ifdef SIGTTIN | 6009 | #ifdef SIGTTIN |
| 6007 | handle_signal ("SIGTTIN", SIGTTIN); | 6010 | handle_signal ("TTIN", SIGTTIN); |
| 6008 | #endif | 6011 | #endif |
| 6009 | #ifdef SIGTTOU | 6012 | #ifdef SIGTTOU |
| 6010 | handle_signal ("SIGTTOU", SIGTTOU); | 6013 | handle_signal ("TTOU", SIGTTOU); |
| 6011 | #endif | 6014 | #endif |
| 6012 | #ifdef SIGIO | 6015 | #ifdef SIGIO |
| 6013 | handle_signal ("SIGIO", SIGIO); | 6016 | handle_signal ("IO", SIGIO); |
| 6014 | #endif | 6017 | #endif |
| 6015 | #ifdef SIGXCPU | 6018 | #ifdef SIGXCPU |
| 6016 | handle_signal ("SIGXCPU", SIGXCPU); | 6019 | handle_signal ("XCPU", SIGXCPU); |
| 6017 | #endif | 6020 | #endif |
| 6018 | #ifdef SIGXFSZ | 6021 | #ifdef SIGXFSZ |
| 6019 | handle_signal ("SIGXFSZ", SIGXFSZ); | 6022 | handle_signal ("XFSZ", SIGXFSZ); |
| 6020 | #endif | 6023 | #endif |
| 6021 | #ifdef SIGVTALRM | 6024 | #ifdef SIGVTALRM |
| 6022 | handle_signal ("SIGVTALRM", SIGVTALRM); | 6025 | handle_signal ("VTALRM", SIGVTALRM); |
| 6023 | #endif | 6026 | #endif |
| 6024 | #ifdef SIGPROF | 6027 | #ifdef SIGPROF |
| 6025 | handle_signal ("SIGPROF", SIGPROF); | 6028 | handle_signal ("PROF", SIGPROF); |
| 6026 | #endif | 6029 | #endif |
| 6027 | #ifdef SIGWINCH | 6030 | #ifdef SIGWINCH |
| 6028 | handle_signal ("SIGWINCH", SIGWINCH); | 6031 | handle_signal ("WINCH", SIGWINCH); |
| 6029 | #endif | 6032 | #endif |
| 6030 | #ifdef SIGINFO | 6033 | #ifdef SIGINFO |
| 6031 | handle_signal ("SIGINFO", SIGINFO); | 6034 | handle_signal ("INFO", SIGINFO); |
| 6032 | #endif | 6035 | #endif |
| 6033 | #ifdef SIGUSR1 | 6036 | #ifdef SIGUSR1 |
| 6034 | handle_signal ("SIGUSR1", SIGUSR1); | 6037 | handle_signal ("USR1", SIGUSR1); |
| 6035 | #endif | 6038 | #endif |
| 6036 | #ifdef SIGUSR2 | 6039 | #ifdef SIGUSR2 |
| 6037 | handle_signal ("SIGUSR2", SIGUSR2); | 6040 | handle_signal ("USR2", SIGUSR2); |
| 6038 | #endif | 6041 | #endif |
| 6039 | else | 6042 | else |
| 6040 | error ("Undefined signal name %s", name); | 6043 | error ("Undefined signal name %s", name); |