1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

Voidify more mkdir_p calls

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-03-27 11:33:50 +01:00
parent ca78ad1de9
commit 6e5dcce4b1
6 changed files with 8 additions and 13 deletions

View 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) {

View 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)

View 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)

View 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;

View 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;

View 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);
}