summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-07-06 19:27:20 -0400
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:05:57 +0100
commite2f0672c84ecd7c8a7507d6c1d7ebec1f6348524 (patch)
treee13c9a445d4797b2256d286a30ec035896477bc4 /src
parent1c41caca9ff73085513b988edbb341e076244298 (diff)
tree-wide: fix write_string_file() user that should not create files
The latest consolidation cleanup of write_string_file() revealed some users of that helper which should have used write_string_file_no_create() in the past but didn't. Basically, all existing users that write to files in /sys and /proc should not expect to write to a file which is not yet existant.
Diffstat (limited to 'src')
-rw-r--r--src/shared/smack-util.c2
-rw-r--r--src/shared/sysctl-util.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/smack-util.c b/src/shared/smack-util.c
index 0c3697b61..047aa294f 100644
--- a/src/shared/smack-util.c
+++ b/src/shared/smack-util.c
@@ -139,7 +139,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) {
return 0;
p = procfs_file_alloca(pid, "attr/current");
- r = write_string_file(p, label, WRITE_STRING_FILE_CREATE);
+ r = write_string_file(p, label, 0);
if (r < 0)
return r;
#endif
diff --git a/src/shared/sysctl-util.c b/src/shared/sysctl-util.c
index 232a00505..1de0b94fd 100644
--- a/src/shared/sysctl-util.c
+++ b/src/shared/sysctl-util.c
@@ -66,7 +66,7 @@ int sysctl_write(const char *property, const char *value) {
log_debug("Setting '%s' to '%s'", property, value);
p = strjoina("/proc/sys/", property);
- return write_string_file(p, value, WRITE_STRING_FILE_CREATE);
+ return write_string_file(p, value, 0);
}
int sysctl_read(const char *property, char **content) {