]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: pass return value of make_null_stdio() to warning instead of errno (#4328)
author0xAX <0xAX@users.noreply.github.com>
Mon, 10 Oct 2016 17:51:33 +0000 (20:51 +0300)
committerLennart Poettering <lennart@poettering.net>
Mon, 10 Oct 2016 17:51:33 +0000 (19:51 +0200)
as @poettering suggested in the #4320

src/core/main.c
src/udev/udevd.c

index 0fad3933233a77c4489eca387a4be227ea78dfaf..30d9c43fbb341a01bd185109613e87a4efa989ca 100644 (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();
index 6000d9c7ec6c23ed58f0b9d5ee1ea5661c39e1ea..535d317c276ace2173d9716e1ed64e6f9f1c5cef 100644 (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();