2010-03-26 01:19:40 +01:00
|
|
|
--- BUILD/FreeWnn-1.1.1-a021/Wnn/jserver/de.c
|
|
|
|
+++ BUILD/FreeWnn-1.1.1-a021/Wnn/jserver/de.c
|
|
|
|
@@ -212,6 +212,19 @@
|
|
|
|
# include <tcpd.h>
|
|
|
|
#endif /* HAVE_LIBWRAP */
|
2007-01-16 00:13:17 +01:00
|
|
|
|
|
|
|
+#ifndef NOTFORK
|
|
|
|
+static void father_sighandler (const int sig)
|
|
|
|
+{
|
|
|
|
+ if (signal(sig, SIG_DFL) == SIG_ERR)
|
|
|
|
+ _exit (2);
|
|
|
|
+
|
|
|
|
+ if (sig == SIGTERM)
|
|
|
|
+ _exit(0);
|
|
|
|
+ else
|
2013-08-21 16:26:34 +02:00
|
|
|
+ _exit(255);
|
2007-01-16 00:13:17 +01:00
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
/* No arguments are used. Only options. */
|
|
|
|
int
|
2010-03-26 01:19:40 +01:00
|
|
|
main (int argc, char *argv[])
|
|
|
|
@@ -248,14 +261,14 @@
|
2007-01-16 00:13:17 +01:00
|
|
|
{
|
2010-03-26 01:19:40 +01:00
|
|
|
if (fork ())
|
|
|
|
{
|
|
|
|
- signal (SIGCHLD, _exit);
|
|
|
|
+ signal (SIGCHLD, father_sighandler);
|
|
|
|
signal (SIGHUP, SIG_IGN);
|
|
|
|
signal (SIGINT, SIG_IGN);
|
|
|
|
signal (SIGQUIT, SIG_IGN);
|
2007-01-16 00:13:17 +01:00
|
|
|
#ifdef SIGTSTP
|
2010-03-26 01:19:40 +01:00
|
|
|
signal (SIGTSTP, SIG_IGN);
|
2007-01-16 00:13:17 +01:00
|
|
|
#endif
|
2010-03-26 01:19:40 +01:00
|
|
|
- signal (SIGTERM, _exit);
|
|
|
|
+ signal (SIGTERM, father_sighandler);
|
|
|
|
pause ();
|
|
|
|
}
|
2007-01-16 00:13:17 +01:00
|
|
|
}
|