Commit 09d61f76 09d61f76311e764e263b9a42f9f105c8b126256c by Alain Magloire

Patch provided by sergey.

1 parent de632534
2001-05-21 Alain Magloire
* configure.in, imap4d/signal.c, pop3d/signal.c:
sys_siglist is not defined on some systems (namely, Solaris).
* lib/signame.c: (added) Provide mu_signame() function to convert
signal number to string representation.
* lib/strtok_r.c: bugfix
2001-05-19 Alain Magloire
* AUTHORS: Update to reflect Sergey and Sam contributions.
......
......@@ -67,6 +67,7 @@ AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_DECL_SYS_SIGLIST
dnl Check for working functions
......
......@@ -39,9 +39,9 @@ imap4d_sigchld (int signo)
RETSIGTYPE
imap4d_signal (int signo)
{
extern const char *const sys_siglist[];
/* syslog (LOG_CRIT, "got signal %d", signo); */
syslog (LOG_CRIT, "got signal %s", sys_siglist[signo]);
extern char *mu_signame __P((int signo));
syslog (LOG_CRIT, "got signal %s", mu_signame(signo));
/* Master process. */
if (!ofile)
{
......
......@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = ansi2knr
noinst_LIBRARIES = libmailutils.a
libmailutils_a_SOURCES = basename.c getopt.c getopt1.c md5.c getline.c \
xstrdup.c xmalloc.c argcv.c
xstrdup.c xmalloc.c argcv.c signame.c
EXTRA_DIST = alloca.c fnmatch.c setenv.c snprintf.c strchrnul.c strndup.c \
strnlen.c strtok_r.c xstrtol.c vasprintf.c
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <signal.h>
#include <unistd.h>
char *
mu_signame (int signo)
{
#ifdef SYS_SIGLIST_DECLARED
return sys_siglist[signo];
#else
static char buf[64];
snprintf (buf, sizeof buf, "%d", signo);
return buf;
#endif
}
......@@ -54,7 +54,7 @@ strtok_r (s, delim, save_ptr)
if (s == NULL)
/* This token finishes the string. */
/* *save_ptr = __rawmemchr (token, '\0'); */
*save_ptr = s + strlen (token);
*save_ptr = token + strlen (token);
else
{
/* Terminate the token and make *SAVE_PTR point past it. */
......
......@@ -38,7 +38,9 @@ pop3d_sigchld (int signo)
RETSIGTYPE
pop3d_signal (int signo)
{
syslog (LOG_CRIT, "got signal %d", signo);
extern char *mu_signame __P((int signo));
syslog (LOG_CRIT, "got signal %s", mu_signame(signo));
/* Master process. */
if (!ofile)
{
......