summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com>2018-07-27 16:02:51 +0530
committerChristoph Lipka <clipka@users.noreply.github.com>2018-12-21 10:16:46 +0100
commita6b8edcaaf6ae68a20b67e7212e04aeb2218c84a (patch)
treea4c6a6ed09f522e5ff6875c21f95bf59e95db2d8
parentd4ef0bbe46f7cb409792ab62ea1bdd3907fc4489 (diff)
downloadDLT-daemon-a6b8edcaaf6ae68a20b67e7212e04aeb2218c84a.tar.gz
exit DLT daemon if /dev/null open fails during fork
If /dev/null fails to open during DLT daemon's fork handling, it is treated as an error and DLT daemon exits. Signed-off-by: Jeevan Ramakant Nagvekar <jeevan.nagvekar1@wipro.com>
-rw-r--r--src/daemon/dlt-daemon.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index 6c1d070..016b2c9 100644
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -1442,6 +1442,11 @@ void dlt_daemon_daemonize(int verbose)
close(fd);
}
+ else
+ {
+ dlt_log(LOG_CRIT, "Error opening /dev/null, exiting DLT daemon\n");
+ exit(-1); /* fork error */
+ }
/* Set umask */
umask(DLT_DAEMON_UMASK);