X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/a1d2685b08312addc2c6bf772c6f4dd801629a4a..5621e5105a31ea4b5a5ed17d73433c134ae8e048:/socket.c diff --git a/socket.c b/socket.c index ca8c5612..6bedc991 100644 --- a/socket.c +++ b/socket.c @@ -703,35 +703,6 @@ void set_socket_options(int fd, char *options) free(options); } -/** - * Become a daemon, discarding the controlling terminal - **/ -void become_daemon(void) -{ - int i; - - if (fork()) { - _exit(0); - } - - /* detach from the terminal */ -#ifdef HAVE_SETSID - setsid(); -#elif defined TIOCNOTTY - i = open("/dev/tty", O_RDWR); - if (i >= 0) { - ioctl(i, (int)TIOCNOTTY, (char *)0); - close(i); - } -#endif - /* make sure that stdin, stdout an stderr don't stuff things - * up (library functions, for example) */ - for (i = 0; i < 3; i++) { - close(i); - open("/dev/null", O_RDWR); - } -} - /** * This is like socketpair but uses tcp. It is used by the Samba