Commit 09d61f76 09d61f76311e764e263b9a42f9f105c8b126256c by Alain Magloire

Patch provided by sergey.

1 parent de632534
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.
......
...@@ -67,6 +67,7 @@ AC_TYPE_OFF_T ...@@ -67,6 +67,7 @@ AC_TYPE_OFF_T
67 AC_TYPE_PID_T 67 AC_TYPE_PID_T
68 AC_TYPE_SIZE_T 68 AC_TYPE_SIZE_T
69 AC_TYPE_SIGNAL 69 AC_TYPE_SIGNAL
70 AC_DECL_SYS_SIGLIST
70 71
71 dnl Check for working functions 72 dnl Check for working functions
72 73
......
...@@ -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
......
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 {
......