projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'ym/target_set_add_meta' of github.com:ymettier/collectd into target_set...
[collectd.git]
/
src
/
daemon
/
collectd.c
diff --git
a/src/daemon/collectd.c
b/src/daemon/collectd.c
index
06125dc
..
6f29917
100644
(file)
--- a/
src/daemon/collectd.c
+++ b/
src/daemon/collectd.c
@@
-269,6
+269,7
@@
static void update_kstat (void)
/* TODO
* Remove all settings but `-f' and `-C'
*/
/* TODO
* Remove all settings but `-f' and `-C'
*/
+__attribute__((noreturn))
static void exit_usage (int status)
{
printf ("Usage: "PACKAGE_NAME" [OPTIONS]\n\n"
static void exit_usage (int status)
{
printf ("Usage: "PACKAGE_NAME" [OPTIONS]\n\n"
@@
-422,7
+423,7
@@
static int pidfile_remove (void)
#endif /* COLLECT_DAEMON */
#ifdef KERNEL_LINUX
#endif /* COLLECT_DAEMON */
#ifdef KERNEL_LINUX
-int notify_upstart (void)
+
static
int notify_upstart (void)
{
char const *upstart_job = getenv("UPSTART_JOB");
{
char const *upstart_job = getenv("UPSTART_JOB");
@@
-442,7
+443,7
@@
int notify_upstart (void)
return 1;
}
return 1;
}
-int notify_systemd (void)
+
static
int notify_systemd (void)
{
int fd;
const char *notifysocket;
{
int fd;
const char *notifysocket;
@@
-518,7
+519,7
@@
int main (int argc, char **argv)
struct sigaction sig_term_action;
struct sigaction sig_usr1_action;
struct sigaction sig_pipe_action;
struct sigaction sig_term_action;
struct sigaction sig_usr1_action;
struct sigaction sig_pipe_action;
- char *configfile = CONFIGFILE;
+ c
onst c
har *configfile = CONFIGFILE;
int test_config = 0;
int test_readall = 0;
const char *basedir;
int test_config = 0;
int test_readall = 0;
const char *basedir;
@@
-638,6
+639,8
@@
int main (int argc, char **argv)
#endif
)
{
#endif
)
{
+ int status;
+
if ((pid = fork ()) == -1)
{
/* error */
if ((pid = fork ()) == -1)
{
/* error */
@@
-666,19
+669,24
@@
int main (int argc, char **argv)
close (1);
close (0);
close (1);
close (0);
- if (open ("/dev/null", O_RDWR) != 0)
+ status = open ("/dev/null", O_RDWR);
+ if (status != 0)
{
{
- ERROR ("Error: Could not connect `STDIN' to `/dev/null'
"
);
+ ERROR ("Error: Could not connect `STDIN' to `/dev/null'
(status %d)", status
);
return (1);
}
return (1);
}
- if (dup (0) != 1)
+
+ status = dup (0);
+ if (status != 1)
{
{
- ERROR ("Error: Could not connect `STDOUT' to `/dev/null'
"
);
+ ERROR ("Error: Could not connect `STDOUT' to `/dev/null'
(status %d)", status
);
return (1);
}
return (1);
}
- if (dup (0) != 2)
+
+ status = dup (0);
+ if (status != 2)
{
{
- ERROR ("Error: Could not connect `STDERR' to `/dev/null'
"
);
+ ERROR ("Error: Could not connect `STDERR' to `/dev/null'
, (status %d)", status
);
return (1);
}
} /* if (daemonize) */
return (1);
}
} /* if (daemonize) */