Merge branch 'pull/collectd-4' into collectd-4
authorFlorian Forster <octo@huhu.verplant.org>
Thu, 10 May 2007 07:51:04 +0000 (09:51 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Thu, 10 May 2007 07:51:04 +0000 (09:51 +0200)
1  2 
src/unixsock.c

diff --combined src/unixsock.c
@@@ -29,6 -29,7 +29,6 @@@
  
  #include <sys/socket.h>
  #include <sys/un.h>
 -#include <sys/poll.h>
  
  #include <grp.h>
  
@@@ -149,9 -150,9 +149,9 @@@ static int cache_insert (const data_set
        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));
@@@ -783,6 -784,15 +783,15 @@@ static void *us_server_thread (void *ar
        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 */