email plugin: Don't unlink the socket file on startup.
authorSebastian Harl <sh@tokkee.org>
Tue, 17 Jun 2008 17:59:14 +0000 (19:59 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 24 Jun 2008 11:22:56 +0000 (13:22 +0200)
Usually, collectd runs as user root, thus making it an unsafe operation to
unconditionally remove the file even though one should be able to assume
that it "belongs" to collectd.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/email.c

index b718cf5..c78d761 100644 (file)
@@ -513,7 +513,6 @@ static void *open_connection (void *arg)
 
        strncpy (addr.sun_path, sock_file, (size_t)(UNIX_PATH_MAX - 1));
        addr.sun_path[UNIX_PATH_MAX - 1] = '\0';
-       unlink (addr.sun_path);
 
        errno = 0;
        if (-1 == bind (connector_socket, (struct sockaddr *)&addr,