It takes _talent_ to implement a version of nohup that does everything except
the actual blocking of HUP.
This commit is contained in:
parent
a81cec9192
commit
fa6b5e62c2
@ -10,6 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
@ -44,8 +45,8 @@ int nohup_main(int argc, char *argv[])
|
|||||||
temp = isatty(2);
|
temp = isatty(2);
|
||||||
if (temp) fdprintf(2,"Writing to %s\n", home ? home : nohupout);
|
if (temp) fdprintf(2,"Writing to %s\n", home ? home : nohupout);
|
||||||
dup2(temp ? 1 : nullfd, 2);
|
dup2(temp ? 1 : nullfd, 2);
|
||||||
|
|
||||||
close(nullfd);
|
close(nullfd);
|
||||||
|
signal (SIGHUP, SIG_IGN);
|
||||||
|
|
||||||
// Exec our new program.
|
// Exec our new program.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user