summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3dc0454)
raw | patch | inline | side by side (parent: 3dc0454)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 2 Apr 2016 13:35:59 +0000 (15:35 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 2 Apr 2016 13:41:33 +0000 (15:41 +0200) |
Fixed CID #73119
Fix a typo in the error message while we're at it.
Fix a typo in the error message while we're at it.
src/collectdmon.c | patch | blob | history |
diff --git a/src/collectdmon.c b/src/collectdmon.c
index 2c1d58978bc175221bf3fd71448b2930c0a4aaab..13304f2a18075d2333c98c7daae66b64db8e766f 100644 (file)
--- a/src/collectdmon.c
+++ b/src/collectdmon.c
dev_null = open ("/dev/null", O_RDWR);
if (dev_null == -1) {
- syslog (LOG_ERR, "Error: couldn't failed to open /dev/null: %s", strerror (errno));
+ syslog (LOG_ERR, "Error: couldn't open /dev/null: %s", strerror (errno));
return -1;
}
if (dup2 (dev_null, STDIN_FILENO) == -1) {
+ close (dev_null);
syslog (LOG_ERR, "Error: couldn't connect STDIN to /dev/null: %s", strerror (errno));
return -1;
}
if (dup2 (dev_null, STDOUT_FILENO) == -1) {
+ close (dev_null);
syslog (LOG_ERR, "Error: couldn't connect STDOUT to /dev/null: %s", strerror (errno));
return -1;
}
if (dup2 (dev_null, STDERR_FILENO) == -1) {
+ close (dev_null);
syslog (LOG_ERR, "Error: couldn't connect STDERR to /dev/null: %s", strerror (errno));
return -1;
}