projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c1292ab
)
Changed collectd.c so the `-P pidfile' option has an effect
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
2f05b93
..
418a5d7
100644
(file)
--- a/
src/collectd.c
+++ b/
src/collectd.c
@@
-216,13
+216,16
@@
int start_server (void)
}
#endif /* HAVE_LIBRRD */
}
#endif /* HAVE_LIBRRD */
-int pidfile_create (
void
)
+int pidfile_create (
char *file
)
{
FILE *fh;
{
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);
}
return (1);
}
@@
-368,7
+371,7
@@
int main (int argc, char **argv)
setsid ();
/* Write pidfile */
setsid ();
/* Write pidfile */
- if (pidfile_create ())
+ if (pidfile_create (
pidfile
))
exit (2);
/* close standard descriptors */
exit (2);
/* close standard descriptors */