r3183: moved the unlink of the messaging unixdom socket to the messaging destructor
[bbaumbach/samba-autobuild/.git] / source4 / lib / messaging / messaging.c
index e78ec83b4b1a757d5e2e5eb746a0c5cae4c1ac33..13c1a049f8470afb3923829ce0a1e435433a39d6 100644 (file)
@@ -95,8 +95,9 @@ static char *messaging_path(TALLOC_CTX *mem_ctx, servid_t server_id)
 */
 static void messaging_dispatch(struct messaging_state *msg, struct messaging_rec *rec)
 {
-       struct dispatch_fn *d;
-       for (d=msg->dispatch;d;d=d->next) {
+       struct dispatch_fn *d, *next;
+       for (d=msg->dispatch;d;d=next) {
+               next = d->next;
                if (d->msg_type == rec->header.msg_type) {
                        d->fn(msg, d->private, d->msg_type, rec->header.from, &rec->data);
                }
@@ -434,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;
 }