summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c1292ab)
raw | patch | inline | side by side (parent: c1292ab)
author | octo <octo> | |
Fri, 16 Dec 2005 12:36:34 +0000 (12:36 +0000) | ||
committer | octo <octo> | |
Fri, 16 Dec 2005 12:36:34 +0000 (12:36 +0000) |
src/collectd.c | patch | blob | history |
diff --git a/src/collectd.c b/src/collectd.c
index 2f05b93f0caaef3c60b2b8504e878ff582211b0d..418a5d7433ecd789115227342907fed1eec3029d 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
}
#endif /* HAVE_LIBRRD */
-int pidfile_create (void)
+int pidfile_create (char *file)
{
FILE *fh;
- if ((fh = fopen (PIDFILE, "w")) == NULL)
+ if (file == NULL)
+ file = PIDFILE;
+
+ if ((fh = fopen (file, "w")) == NULL)
{
- syslog (LOG_ERR, "fopen (pidfile): %s", strerror (errno));
+ syslog (LOG_ERR, "fopen (%s): %s", file, strerror (errno));
return (1);
}
setsid ();
/* Write pidfile */
- if (pidfile_create ())
+ if (pidfile_create (pidfile))
exit (2);
/* close standard descriptors */