From 080df5f215fcc480a3ca1f4841491c1997632764 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 8 May 2007 23:06:44 +0200 Subject: [PATCH] unixsock plugin: Remove the socket-file after closing the socket. --- src/unixsock.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/unixsock.c b/src/unixsock.c index ac7828fe..e73f04ac 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -150,9 +150,9 @@ static int cache_insert (const data_set_t *ds, const value_list_t *vl) value_cache_t *vc; int i; - DEBUG ("unixsock plugin: cache_insert: ds->ds_num = %i;" + DEBUG ("unixsock plugin: cache_insert: ds->type = %s; ds->ds_num = %i;" " vl->values_len = %i;", - ds->ds_num, vl->values_len); + ds->type, ds->ds_num, vl->values_len); assert (ds->ds_num == vl->values_len); vc = (value_cache_t *) malloc (sizeof (value_cache_t)); @@ -784,6 +784,15 @@ static void *us_server_thread (void *arg) close (sock_fd); sock_fd = -1; + status = unlink ((sock_file != NULL) ? sock_file : US_DEFAULT_PATH); + if (status != 0) + { + char errbuf[1024]; + NOTICE ("unixsock plugin: unlink (%s) failed: %s", + (sock_file != NULL) ? sock_file : US_DEFAULT_PATH, + sstrerror (errno, errbuf, sizeof (errbuf))); + } + return ((void *) 0); } /* void *us_server_thread */ -- 2.11.0