tree-wide: pass return value of make_null_stdio() to warning instead of errno (#4328)

as @poettering suggested in the #4320
This commit is contained in:
0xAX
2016-10-10 20:51:33 +03:00
committed by Lennart Poettering
parent a0f72a24e0
commit c76cf844d6
2 changed files with 9 additions and 5 deletions

View File

@@ -1532,8 +1532,9 @@ int main(int argc, char *argv[]) {
* need to do that for user instances since they never log
* into the console. */
log_show_color(colors_enabled());
if (make_null_stdio() < 0)
log_warning_errno(errno, "Failed to redirect standard streams to /dev/null: %m");
r = make_null_stdio();
if (r < 0)
log_warning_errno(r, "Failed to redirect standard streams to /dev/null: %m");
}
r = initialize_join_controllers();

View File

@@ -1738,9 +1738,12 @@ int main(int argc, char *argv[]) {
log_info("starting version " VERSION);
/* connect /dev/null to stdin, stdout, stderr */
if (log_get_max_level() < LOG_DEBUG)
if (make_null_stdio() < 0)
log_warning_errno(errno, "Failed to redirect standard streams to /dev/null: %m");
if (log_get_max_level() < LOG_DEBUG) {
r = make_null_stdio();
if (r < 0)
log_warning_errno(r, "Failed to redirect standard streams to /dev/null: %m");
}
pid = fork();