r3183: moved the unlink of the messaging unixdom socket to the messaging destructor
authorAndrew Tridgell <tridge@samba.org>
Mon, 25 Oct 2004 03:30:39 +0000 (03:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:04:37 +0000 (13:04 -0500)
(This used to be commit ab222b236a091d31b1f5f2cba150a11585ab5836)

source4/lib/messaging/messaging.c
source4/lib/socket/socket_unix.c

index b0ca9cc41e3c7f9800fd75e32fde37159d660ef2..13c1a049f8470afb3923829ce0a1e435433a39d6 100644 (file)
@@ -435,6 +435,7 @@ static int messaging_destructor(void *msg_ctx)
 {
        struct messaging_state *msg = msg_ctx;
        event_remove_fd(msg->event.ev, msg->event.fde);
+       unlink(msg->path);
        return 0;
 }
 
index 038ce3b3b6882c8795e5750e062808eb7d5908e3..df929d92b4b4a1d16a4db9b71a00ad4b852a47dd 100644 (file)
@@ -71,15 +71,6 @@ static NTSTATUS unixdom_init(struct socket_context *sock)
 static void unixdom_close(struct socket_context *sock)
 {
        close(sock->fd);
-       /* if we were listening, then don't leave the socket lying
-          around in the filesystem */
-
-#if 0
-       /* FIXME - this doesn't work after fork(), etc */
-       if (sock->private_data) {
-               unlink((const char *)sock->private_data);
-       }
-#endif
 }
 
 static NTSTATUS unixdom_connect(struct socket_context *sock,