The make_null_stdio() may fail. Let's check its result and print
warning message instead of keeping silence.
* need to do that for user instances since they never log
* into the console. */
log_show_color(colors_enabled());
- make_null_stdio();
+ if (make_null_stdio() < 0)
+ log_warning_errno(errno, "Failed to redirect standard streams to /dev/null: %m");
}
/* Initialize default unit */
/* connect /dev/null to stdin, stdout, stderr */
if (log_get_max_level() < LOG_DEBUG)
- (void) make_null_stdio();
+ if (make_null_stdio() < 0)
+ log_warning_errno(errno, "Failed to redirect standard streams to /dev/null: %m");
+
pid = fork();
switch (pid) {