summaryrefslogtreecommitdiff
path: root/src/rfkill
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-24 18:43:56 +0200
committerLennart Poettering <lennart@poettering.net>2019-05-08 06:36:20 -0400
commite82e549fb2cd97966bd3a5d38dfab15e3d9cd7b6 (patch)
tree88197e8586bedd3d4f69eef35f3a9eaf555c141d /src/rfkill
parent22e596d6d5fa80fb33ab84451db8962e2facb17a (diff)
downloadsystemd-e82e549fb2cd97966bd3a5d38dfab15e3d9cd7b6.tar.gz
tree-wide: make use of the new WRITE_STRING_FILE_MKDIR_0755 flag
Diffstat (limited to 'src/rfkill')
-rw-r--r--src/rfkill/rfkill.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c
index 16610cd476..fe26566fa3 100644
--- a/src/rfkill/rfkill.c
+++ b/src/rfkill/rfkill.c
@@ -154,7 +154,7 @@ static int load_state(Context *c, const struct rfkill_event *event) {
if (IN_SET(r, -ENOENT, 0)) {
/* No state file or it's truncated? Then save the current state */
- r = write_string_file(state_file, one_zero(event->soft), WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC);
+ r = write_string_file(state_file, one_zero(event->soft), WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC|WRITE_STRING_FILE_MKDIR_0755);
if (r < 0)
return log_error_errno(r, "Failed to write state file %s: %m", state_file);
@@ -246,7 +246,7 @@ static int save_state_cancel(Context *c, const struct rfkill_event *event) {
static int save_state_write_one(struct write_queue_item *item) {
int r;
- r = write_string_file(item->file, one_zero(item->state), WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC);
+ r = write_string_file(item->file, one_zero(item->state), WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC|WRITE_STRING_FILE_MKDIR_0755);
if (r < 0)
return log_error_errno(r, "Failed to write state file %s: %m", item->file);
@@ -280,10 +280,6 @@ static int run(int argc, char *argv[]) {
umask(0022);
- r = mkdir_p("/var/lib/systemd/rfkill", 0755);
- if (r < 0)
- return log_error_errno(r, "Failed to create rfkill directory: %m");
-
n = sd_listen_fds(false);
if (n < 0)
return log_error_errno(n, "Failed to determine whether we got any file descriptors passed: %m");