Patch provided by sergey.
Showing
7 changed files
with
52 additions
and
6 deletions
1 | 2001-05-21 Alain Magloire | ||
2 | |||
3 | * configure.in, imap4d/signal.c, pop3d/signal.c: | ||
4 | sys_siglist is not defined on some systems (namely, Solaris). | ||
5 | * lib/signame.c: (added) Provide mu_signame() function to convert | ||
6 | signal number to string representation. | ||
7 | * lib/strtok_r.c: bugfix | ||
8 | |||
1 | 2001-05-19 Alain Magloire | 9 | 2001-05-19 Alain Magloire |
2 | 10 | ||
3 | * AUTHORS: Update to reflect Sergey and Sam contributions. | 11 | * AUTHORS: Update to reflect Sergey and Sam contributions. | ... | ... |
... | @@ -39,9 +39,9 @@ imap4d_sigchld (int signo) | ... | @@ -39,9 +39,9 @@ imap4d_sigchld (int signo) |
39 | RETSIGTYPE | 39 | RETSIGTYPE |
40 | imap4d_signal (int signo) | 40 | imap4d_signal (int signo) |
41 | { | 41 | { |
42 | extern const char *const sys_siglist[]; | 42 | extern char *mu_signame __P((int signo)); |
43 | /* syslog (LOG_CRIT, "got signal %d", signo); */ | 43 | |
44 | syslog (LOG_CRIT, "got signal %s", sys_siglist[signo]); | 44 | syslog (LOG_CRIT, "got signal %s", mu_signame(signo)); |
45 | /* Master process. */ | 45 | /* Master process. */ |
46 | if (!ofile) | 46 | if (!ofile) |
47 | { | 47 | { | ... | ... |
... | @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = ansi2knr | ... | @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = ansi2knr |
2 | noinst_LIBRARIES = libmailutils.a | 2 | noinst_LIBRARIES = libmailutils.a |
3 | 3 | ||
4 | libmailutils_a_SOURCES = basename.c getopt.c getopt1.c md5.c getline.c \ | 4 | libmailutils_a_SOURCES = basename.c getopt.c getopt1.c md5.c getline.c \ |
5 | xstrdup.c xmalloc.c argcv.c | 5 | xstrdup.c xmalloc.c argcv.c signame.c |
6 | 6 | ||
7 | EXTRA_DIST = alloca.c fnmatch.c setenv.c snprintf.c strchrnul.c strndup.c \ | 7 | EXTRA_DIST = alloca.c fnmatch.c setenv.c snprintf.c strchrnul.c strndup.c \ |
8 | strnlen.c strtok_r.c xstrtol.c vasprintf.c | 8 | strnlen.c strtok_r.c xstrtol.c vasprintf.c | ... | ... |
lib/signame.c
0 → 100644
1 | /* GNU mailutils - a suite of utilities for electronic mail | ||
2 | Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Library Public License as published by | ||
6 | the Free Software Foundation; either version 2, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU Library General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this program; if not, write to the Free Software | ||
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | ||
17 | |||
18 | |||
19 | #if HAVE_CONFIG_H | ||
20 | # include <config.h> | ||
21 | #endif | ||
22 | #include <signal.h> | ||
23 | #include <unistd.h> | ||
24 | |||
25 | char * | ||
26 | mu_signame (int signo) | ||
27 | { | ||
28 | #ifdef SYS_SIGLIST_DECLARED | ||
29 | return sys_siglist[signo]; | ||
30 | #else | ||
31 | static char buf[64]; | ||
32 | snprintf (buf, sizeof buf, "%d", signo); | ||
33 | return buf; | ||
34 | #endif | ||
35 | } |
... | @@ -54,7 +54,7 @@ strtok_r (s, delim, save_ptr) | ... | @@ -54,7 +54,7 @@ strtok_r (s, delim, save_ptr) |
54 | if (s == NULL) | 54 | if (s == NULL) |
55 | /* This token finishes the string. */ | 55 | /* This token finishes the string. */ |
56 | /* *save_ptr = __rawmemchr (token, '\0'); */ | 56 | /* *save_ptr = __rawmemchr (token, '\0'); */ |
57 | *save_ptr = s + strlen (token); | 57 | *save_ptr = token + strlen (token); |
58 | else | 58 | else |
59 | { | 59 | { |
60 | /* Terminate the token and make *SAVE_PTR point past it. */ | 60 | /* Terminate the token and make *SAVE_PTR point past it. */ | ... | ... |
... | @@ -38,7 +38,9 @@ pop3d_sigchld (int signo) | ... | @@ -38,7 +38,9 @@ pop3d_sigchld (int signo) |
38 | RETSIGTYPE | 38 | RETSIGTYPE |
39 | pop3d_signal (int signo) | 39 | pop3d_signal (int signo) |
40 | { | 40 | { |
41 | syslog (LOG_CRIT, "got signal %d", signo); | 41 | extern char *mu_signame __P((int signo)); |
42 | |||
43 | syslog (LOG_CRIT, "got signal %s", mu_signame(signo)); | ||
42 | /* Master process. */ | 44 | /* Master process. */ |
43 | if (!ofile) | 45 | if (!ofile) |
44 | { | 46 | { | ... | ... |
-
Please register or sign in to post a comment