X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/4eff3051a0d2d58c04e6f2ea7264a1e3b05caf9c..ce72de30ce4d850bdd0985cbcd5d686470745934:/socket.c diff --git a/socket.c b/socket.c index 51c07f72..6bedc991 100644 --- a/socket.c +++ b/socket.c @@ -25,6 +25,7 @@ * emulate it using the KAME implementation. */ #include "rsync.h" +#include "ifuncs.h" #include #include #include @@ -702,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