X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5dd6771b28c257af405d7248639ed0e3bcdce38b..e4990ecc1ff236e73d8a44f37c2744c772b95875:/sbr/push.c?ds=inline diff --git a/sbr/push.c b/sbr/push.c index ce00f68d..03e8a456 100644 --- a/sbr/push.c +++ b/sbr/push.c @@ -9,7 +9,6 @@ #include #include -#include void @@ -24,7 +23,7 @@ push(void) switch (pid) { case -1: /* fork error */ - advise (NULL, "unable to fork, so can't push..."); + inform("unable to fork, so can't push..."); break; case 0: @@ -38,8 +37,15 @@ push(void) SIGNAL (SIGTTIN, SIG_IGN); SIGNAL (SIGTTOU, SIG_IGN); #endif - freopen ("/dev/null", "r", stdin); - freopen ("/dev/null", "w", stdout); + + unregister_for_removal(0); + + if (freopen ("/dev/null", "r", stdin) == NULL) { + advise ("stdin", "freopen"); + } + if (freopen ("/dev/null", "w", stdout) == NULL) { + advise ("stdout", "freopen"); + } break; default: