]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Voidify more mkdir_p calls
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 27 Mar 2019 10:33:50 +0000 (11:33 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 27 Mar 2019 10:53:12 +0000 (11:53 +0100)
src/core/automount.c
src/coredump/coredump.c
src/journal/journald-stream.c
src/locale/keymap-util.c
src/login/logind-dbus.c
src/shared/machine-image.c

index 8ffdad18c70035bd367ddb401b5d5effe7ff3fba..f425010cad9592b367db31e803b195109346f2cf 100644 (file)
@@ -759,7 +759,7 @@ static void automount_enter_running(Automount *a) {
                 return;
         }
 
-        mkdir_p_label(a->where, a->directory_mode);
+        (void) mkdir_p_label(a->where, a->directory_mode);
 
         /* Before we do anything, let's see if somebody is playing games with us? */
         if (lstat(a->where, &st) < 0) {
index 85e265c21803b553a3061ba017d0affccd1436a2..023701646b65e7bf216b4c661d8dedd5ddb29e2e 100644 (file)
@@ -369,7 +369,7 @@ static int save_external_coredump(
         if (r < 0)
                 return log_error_errno(r, "Failed to determine coredump file name: %m");
 
-        mkdir_p_label("/var/lib/systemd/coredump", 0755);
+        (void) mkdir_p_label("/var/lib/systemd/coredump", 0755);
 
         fd = open_tmpfile_linkable(fn, O_RDWR|O_CLOEXEC, &tmp);
         if (fd < 0)
index 137c8f04469d63683361c7557155ffd0fa7df6ff..aa2db6863475396a0cedde96b139722999a84af0 100644 (file)
@@ -159,7 +159,7 @@ static int stdout_stream_save(StdoutStream *s) {
                         return log_oom();
         }
 
-        mkdir_p("/run/systemd/journal/streams", 0755);
+        (void) mkdir_p("/run/systemd/journal/streams", 0755);
 
         r = fopen_temporary(s->state_file, &f, &temp_path);
         if (r < 0)
index 76d8a4e0413c23df0d21a3da66930139775dda3e..17540089bafe2c822baf10595cf41ddc2a3d41d3 100644 (file)
@@ -422,8 +422,7 @@ int x11_write_data(Context *c) {
                 return 0;
         }
 
-        mkdir_p_label("/etc/X11/xorg.conf.d", 0755);
-
+        (void) mkdir_p_label("/etc/X11/xorg.conf.d", 0755);
         r = fopen_temporary("/etc/X11/xorg.conf.d/00-keyboard.conf", &f, &temp_path);
         if (r < 0)
                 return r;
index 3ea182323831fe7d27409d80c878702973e050cd..e8d40ab185c4b81f060a4602eaec95db22293fa1 100644 (file)
@@ -1198,8 +1198,7 @@ static int method_set_user_linger(sd_bus_message *message, void *userdata, sd_bu
         if (r == 0)
                 return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
 
-        mkdir_p_label("/var/lib/systemd", 0755);
-
+        (void) mkdir_p_label("/var/lib/systemd", 0755);
         r = mkdir_safe_label("/var/lib/systemd/linger", 0755, 0, 0, MKDIR_WARN_MODE);
         if (r < 0)
                 return r;
index c5a6f2d4eeae96a54d3eb0137c4fff9d31b77eb6..458eb98f1db91c94396e9c5a159c73af58538280 100644 (file)
@@ -1032,7 +1032,7 @@ int image_path_lock(const char *path, int operation, LockFile *global, LockFile
         }
 
         if (p) {
-                mkdir_p("/run/systemd/nspawn/locks", 0700);
+                (void) mkdir_p("/run/systemd/nspawn/locks", 0700);
 
                 r = make_lock_file(p, operation, global);
                 if (r < 0) {
@@ -1169,8 +1169,6 @@ int image_read_metadata(Image *i) {
 }
 
 int image_name_lock(const char *name, int operation, LockFile *ret) {
-        const char *p;
-
         assert(name);
         assert(ret);
 
@@ -1187,9 +1185,8 @@ int image_name_lock(const char *name, int operation, LockFile *ret) {
         if (streq(name, ".host"))
                 return -EBUSY;
 
-        mkdir_p("/run/systemd/nspawn/locks", 0700);
-        p = strjoina("/run/systemd/nspawn/locks/name-", name);
-
+        const char *p = strjoina("/run/systemd/nspawn/locks/name-", name);
+        (void) mkdir_p("/run/systemd/nspawn/locks", 0700);
         return make_lock_file(p, operation, ret);
 }