3ff80c84d8
Copy from M17N/fwnn based on submit request 34857 from user coolo OBS-URL: https://build.opensuse.org/request/show/34857 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fwnn?expand=0&rev=8
40 lines
808 B
Diff
40 lines
808 B
Diff
--- 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 */
|
|
|
|
+#ifndef NOTFORK
|
|
+static void father_sighandler (const int sig)
|
|
+{
|
|
+ if (signal(sig, SIG_DFL) == SIG_ERR)
|
|
+ _exit (2);
|
|
+
|
|
+ if (sig == SIGTERM)
|
|
+ _exit(0);
|
|
+ else
|
|
+ _exit(-1);
|
|
+}
|
|
+#endif
|
|
+
|
|
/* No arguments are used. Only options. */
|
|
int
|
|
main (int argc, char *argv[])
|
|
@@ -248,14 +261,14 @@
|
|
{
|
|
if (fork ())
|
|
{
|
|
- signal (SIGCHLD, _exit);
|
|
+ signal (SIGCHLD, father_sighandler);
|
|
signal (SIGHUP, SIG_IGN);
|
|
signal (SIGINT, SIG_IGN);
|
|
signal (SIGQUIT, SIG_IGN);
|
|
#ifdef SIGTSTP
|
|
signal (SIGTSTP, SIG_IGN);
|
|
#endif
|
|
- signal (SIGTERM, _exit);
|
|
+ signal (SIGTERM, father_sighandler);
|
|
pause ();
|
|
}
|
|
}
|