Don't try to delete when list_only is set.
[rsync/rsync.git] / socket.c
index 51c07f7..6bedc99 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -25,6 +25,7 @@
  * emulate it using the KAME implementation. */
 
 #include "rsync.h"
+#include "ifuncs.h"
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
@@ -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