]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: take benefit of the fact that fdset_free() returns NULL
authorLennart Poettering <lennart@poettering.net>
Tue, 22 Sep 2015 23:05:55 +0000 (01:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 29 Sep 2015 19:08:37 +0000 (21:08 +0200)
src/core/main.c
src/nspawn/nspawn.c

index 3ba92e1779fa0f6be9f20d96eadb8fa3bdb38e82..815dbe7bd4efa380b9dd3c8ea2e93e75345ea555 100644 (file)
@@ -1632,8 +1632,7 @@ int main(int argc, char *argv[]) {
 
         /* This will close all file descriptors that were opened, but
          * not claimed by any unit. */
-        fdset_free(fds);
-        fds = NULL;
+        fds = fdset_free(fds);
 
         arg_serialization = safe_fclose(arg_serialization);
 
@@ -1880,11 +1879,7 @@ finish:
                  * but let's hope that doesn't matter.) */
 
                 arg_serialization = safe_fclose(arg_serialization);
-
-                if (fds) {
-                        fdset_free(fds);
-                        fds = NULL;
-                }
+                fds = fdset_free(fds);
 
                 /* Reopen the console */
                 make_console_stdio();
@@ -1920,11 +1915,7 @@ finish:
         }
 
         arg_serialization = safe_fclose(arg_serialization);
-
-        if (fds) {
-                fdset_free(fds);
-                fds = NULL;
-        }
+        fds = fdset_free(fds);
 
 #ifdef HAVE_VALGRIND_VALGRIND_H
         /* If we are PID 1 and running under valgrind, then let's exit
index f4721a1c29ef9aa10e6c7bc8b3c37f6267d2e460..cb4e87fd74c06abfc274ad0be35bed0d18e99dc0 100644 (file)
@@ -3338,8 +3338,7 @@ int main(int argc, char *argv[]) {
 
                 barrier_set_role(&barrier, BARRIER_PARENT);
 
-                fdset_free(fds);
-                fds = NULL;
+                fds = fdset_free(fds);
 
                 kmsg_socket_pair[1] = safe_close(kmsg_socket_pair[1]);
                 rtnl_socket_pair[1] = safe_close(rtnl_socket_pair[1]);