Package: dbmail Version: 2.2.10-1 Severity: important Tags: patch Dbmail fails to compile because on Hurd SA_SIGINFO is not implemented and therefore is not declared.
Build error: > gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -Wall -O1 -I/usr/include/glib-2.0 > -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 > -I/usr/lib/glib-2.0/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 > -I/usr/include/gmime-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include > -W -Wall -Wpointer-arith -Wstrict-prototypes -MT libdbmail_la-server.lo -MD > -MP -MF .deps/libdbmail_la-server.Tpo -c server.c -fPIC -DPIC -o > .libs/libdbmail_la-server.o > server.c: In function 'SetParentSigHandler': > server.c:62: error: 'SA_SIGINFO' undeclared (first use in this function) > make[3]: *** [libdbmail_la-server.lo] Error 1 > make[3]: Leaving directory `/build/buildd/dbmail-2.2.7' On all signal handlers dbmail does not make use of the funcionalities provided by SA_SIGINFO therefore I provide two patches: - one simple ifdef's SA_SIGINFO. - the other removes SA_SIGINFO and the related arguments from the handlers. Please see what patch you think it's better. -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: hurd-i386 (i686-AT386) Kernel: GNU-Mach 1.3.99/Hurd-0.3 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/bash
--- orig/dbmail-2.2.10/server.c 2008-03-24 14:49:33.530000000 +0000 +++ dbmail-2.2.10/server.c 2008-05-07 20:32:26.860000000 +0000 @@ -44,7 +44,11 @@ ChildInfo_t childinfo; /* some extra prototypes (defintions are below) */ +#ifdef SA_SIGINFO static void ParentSigHandler(int sig, siginfo_t * info, void *data); +#else +static void ParentSigHandler(int sig); +#endif static int SetParentSigHandler(void); static int server_setup(serverConfig_t *conf); @@ -59,11 +63,19 @@ act.sa_sigaction = ParentSigHandler; sigemptyset(&act.sa_mask); +#ifdef SA_SIGINFO act.sa_flags = SA_SIGINFO; +#else + act.sa_flags = 0; +#endif sact.sa_sigaction = ParentSigHandler; sigemptyset(&sact.sa_mask); +#ifdef SA_SIGINFO sact.sa_flags = SA_SIGINFO | SA_NOCLDSTOP; +#else + sact.sa_flags = SA_NOCLDSTOP; +#endif sigaction(SIGCHLD, &sact, 0); sigaction(SIGINT, &sact, 0); @@ -329,7 +341,11 @@ return result; } +#ifdef SA_SIGINFO void ParentSigHandler(int sig, siginfo_t * info UNUSED, void *data UNUSED) +#else +void ParentSigHandler(int sig) +#endif { int saved_errno = errno; Restart = 0; --- orig/dbmail-2.2.10/serverchild.c 2008-03-24 14:49:33.550000000 +0000 +++ dbmail-2.2.10/serverchild.c 2008-05-07 20:35:24.000000000 +0000 @@ -68,13 +68,21 @@ connected = 0; } +#ifdef SA_SIGINFO void noop_child_sig_handler(int sig, siginfo_t *info UNUSED, void *data UNUSED) +#else +void noop_child_sig_handler(int sig) +#endif { if (sig == SIGSEGV) _exit(0); } +#ifdef SA_SIGINFO void active_child_sig_handler(int sig, siginfo_t * info UNUSED, void *data UNUSED) +#else +void active_child_sig_handler(int sig) +#endif { int saved_errno = errno; @@ -122,11 +130,19 @@ act.sa_sigaction = active_child_sig_handler; sigemptyset(&act.sa_mask); +#ifdef SA_SIGINFO act.sa_flags = SA_SIGINFO; +#else + act.sa_flags = 0; +#endif rstact.sa_sigaction = active_child_sig_handler; sigemptyset(&rstact.sa_mask); +#ifdef SA_SIGINFO rstact.sa_flags = SA_SIGINFO | SA_RESETHAND; +#else + rstact.sa_flags = SA_RESETHAND; +#endif sigaddset(&act.sa_mask, SIGINT); sigaddset(&act.sa_mask, SIGQUIT); @@ -162,7 +178,11 @@ act.sa_sigaction = noop_child_sig_handler; sigemptyset(&act.sa_mask); +#ifdef SA_SIGINFO act.sa_flags = SA_SIGINFO; +#else + act.sa_flags = 0; +#endif sigaction(SIGINT, &act, 0); sigaction(SIGQUIT, &act, 0); --- orig/dbmail-2.2.10/serverchild.h 2008-03-24 14:49:33.000000000 +0000 +++ dbmail-2.2.10/serverchild.h 2008-05-07 20:36:07.310000000 +0000 @@ -30,8 +30,13 @@ #include "dbmail.h" +#ifdef SA_SIGINFO void active_child_sig_handler(int sig, siginfo_t *info, void *data); void noop_child_sig_handler(int sig, siginfo_t *info, void *data); +#else +void active_child_sig_handler(int sig); +void noop_child_sig_handler(int sig); +#endif int SetChildSigHandler(void); int DelChildSigHandler(void); pid_t CreateChild(ChildInfo_t * info); --- orig/dbmail-2.2.10/serverparent.c 2008-03-24 14:49:33.310000000 +0000 +++ dbmail-2.2.10/serverparent.c 2008-05-07 20:48:00.540000000 +0000 @@ -47,7 +47,11 @@ int quiet = 0; static int SetMainSigHandler(void); +#ifdef SA_SIGINFO static void MainSigHandler(int sig, siginfo_t * info, void *data); +#else +static void MainSigHandler(int sig); +#endif static void ClearConfig(serverConfig_t * conf); static void DoConfig(serverConfig_t * conf, const char * const service); static void LoadServerConfig(serverConfig_t * config, const char * const service); @@ -182,7 +186,11 @@ return 0; } +#ifdef SA_SIGINFO void MainSigHandler(int sig, siginfo_t * info UNUSED, void *data UNUSED) +#else +void MainSigHandler(int sig) +#endif { mainSig = sig; @@ -203,7 +211,11 @@ act.sa_sigaction = MainSigHandler; sigemptyset(&act.sa_mask); +#ifdef SA_SIGINFO act.sa_flags = SA_SIGINFO; +#else + act.sa_flags = 0; +#endif sigaction(SIGINT, &act, 0); sigaction(SIGQUIT, &act, 0);
--- orig/dbmail-2.2.10/server.c 2008-03-24 14:49:33.800000000 +0000 +++ dbmail-2.2.10/server.c 2008-05-14 21:40:51.000000000 +0000 @@ -44,7 +44,7 @@ ChildInfo_t childinfo; /* some extra prototypes (defintions are below) */ -static void ParentSigHandler(int sig, siginfo_t * info, void *data); +static void ParentSigHandler(int sig); static int SetParentSigHandler(void); static int server_setup(serverConfig_t *conf); @@ -59,11 +59,11 @@ act.sa_sigaction = ParentSigHandler; sigemptyset(&act.sa_mask); - act.sa_flags = SA_SIGINFO; + act.sa_flags = 0; sact.sa_sigaction = ParentSigHandler; sigemptyset(&sact.sa_mask); - sact.sa_flags = SA_SIGINFO | SA_NOCLDSTOP; + sact.sa_flags = SA_NOCLDSTOP; sigaction(SIGCHLD, &sact, 0); sigaction(SIGINT, &sact, 0); @@ -329,7 +329,7 @@ return result; } -void ParentSigHandler(int sig, siginfo_t * info UNUSED, void *data UNUSED) +void ParentSigHandler(int sig) { int saved_errno = errno; Restart = 0; --- orig/dbmail-2.2.10/serverchild.c 2008-03-24 14:49:33.230000000 +0000 +++ dbmail-2.2.10/serverchild.c 2008-05-14 21:41:47.000000000 +0000 @@ -68,13 +68,13 @@ connected = 0; } -void noop_child_sig_handler(int sig, siginfo_t *info UNUSED, void *data UNUSED) +void noop_child_sig_handler(int sig) { if (sig == SIGSEGV) _exit(0); } -void active_child_sig_handler(int sig, siginfo_t * info UNUSED, void *data UNUSED) +void active_child_sig_handler(int sig) { int saved_errno = errno; @@ -122,11 +122,11 @@ act.sa_sigaction = active_child_sig_handler; sigemptyset(&act.sa_mask); - act.sa_flags = SA_SIGINFO; + act.sa_flags = 0; rstact.sa_sigaction = active_child_sig_handler; sigemptyset(&rstact.sa_mask); - rstact.sa_flags = SA_SIGINFO | SA_RESETHAND; + rstact.sa_flags = SA_RESETHAND; sigaddset(&act.sa_mask, SIGINT); sigaddset(&act.sa_mask, SIGQUIT); @@ -162,7 +162,7 @@ act.sa_sigaction = noop_child_sig_handler; sigemptyset(&act.sa_mask); - act.sa_flags = SA_SIGINFO; + act.sa_flags = 0; sigaction(SIGINT, &act, 0); sigaction(SIGQUIT, &act, 0); --- orig/dbmail-2.2.10/serverchild.h 2008-03-24 14:49:33.390000000 +0000 +++ dbmail-2.2.10/serverchild.h 2008-05-14 21:42:33.230000000 +0000 @@ -30,8 +30,8 @@ #include "dbmail.h" -void active_child_sig_handler(int sig, siginfo_t *info, void *data); -void noop_child_sig_handler(int sig, siginfo_t *info, void *data); +void active_child_sig_handler(int sig); +void noop_child_sig_handler(int sig); int SetChildSigHandler(void); int DelChildSigHandler(void); pid_t CreateChild(ChildInfo_t * info); --- orig/dbmail-2.2.10/serverparent.c 2008-03-24 14:49:33.000000000 +0000 +++ dbmail-2.2.10/serverparent.c 2008-05-14 21:43:25.230000000 +0000 @@ -47,7 +47,7 @@ int quiet = 0; static int SetMainSigHandler(void); -static void MainSigHandler(int sig, siginfo_t * info, void *data); +static void MainSigHandler(int sig); static void ClearConfig(serverConfig_t * conf); static void DoConfig(serverConfig_t * conf, const char * const service); static void LoadServerConfig(serverConfig_t * config, const char * const service); @@ -182,7 +182,7 @@ return 0; } -void MainSigHandler(int sig, siginfo_t * info UNUSED, void *data UNUSED) +void MainSigHandler(int sig) { mainSig = sig; @@ -203,7 +203,7 @@ act.sa_sigaction = MainSigHandler; sigemptyset(&act.sa_mask); - act.sa_flags = SA_SIGINFO; + act.sa_flags = 0; sigaction(SIGINT, &act, 0); sigaction(SIGQUIT, &act, 0);