]>
diplodocus.org Git - nmh/blob - sbr/push.c
1 /* push.c -- push a fork into the background
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
22 inform("unable to fork, so can't push...");
26 /* child, block a few signals and continue */
27 SIGNAL (SIGHUP
, SIG_IGN
);
28 SIGNAL (SIGINT
, SIG_IGN
);
29 SIGNAL (SIGQUIT
, SIG_IGN
);
30 SIGNAL (SIGTERM
, SIG_IGN
);
32 SIGNAL (SIGTSTP
, SIG_IGN
);
33 SIGNAL (SIGTTIN
, SIG_IGN
);
34 SIGNAL (SIGTTOU
, SIG_IGN
);
37 unregister_for_removal(0);
39 if (freopen ("/dev/null", "r", stdin
) == NULL
) {
40 advise ("stdin", "freopen");
42 if (freopen ("/dev/null", "w", stdout
) == NULL
) {
43 advise ("stdout", "freopen");
48 /* parent, just exit */