diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-07-08 17:13:53 -0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-07-08 17:13:53 -0300 |
commit | 1434eb3838581f8ee1cef1f15ce9bcd45398183c (patch) | |
tree | 06569be09f377c94322f1c6522b85f8c62376887 /src/core | |
parent | 380aea0c5ba373df9fe37bdf0404442bd9034b92 (diff) | |
parent | ad118bda159d3f9c27c5a15ace54cf808a6e8788 (diff) |
Merge pull request #500 from zonque/fileio
fileio: consolidate write_string_file*()
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/execute.c | 2 | ||||
-rw-r--r-- | src/core/machine-id-setup.c | 2 | ||||
-rw-r--r-- | src/core/main.c | 2 | ||||
-rw-r--r-- | src/core/smack-setup.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index c92db51330..21721dc240 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1446,7 +1446,7 @@ static int exec_child( * shouldn't trip up over that. */ sprintf(t, "%i", context->oom_score_adjust); - r = write_string_file("/proc/self/oom_score_adj", t); + r = write_string_file("/proc/self/oom_score_adj", t, 0); if (r == -EPERM || r == -EACCES) { log_open(); log_unit_debug_errno(unit, r, "Failed to adjust OOM setting, assuming containerized execution, ignoring: %m"); diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c index b3d22840cf..8e26362546 100644 --- a/src/core/machine-id-setup.c +++ b/src/core/machine-id-setup.c @@ -260,7 +260,7 @@ int machine_id_setup(const char *root) { * /run/machine-id as a replacement */ RUN_WITH_UMASK(0022) { - r = write_string_file(run_machine_id, id); + r = write_string_file(run_machine_id, id, WRITE_STRING_FILE_CREATE); } if (r < 0) { (void) unlink(run_machine_id); diff --git a/src/core/main.c b/src/core/main.c index 523f0ce020..c4124576a4 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1203,7 +1203,7 @@ static int write_container_id(void) { if (isempty(c)) return 0; - return write_string_file("/run/systemd/container", c); + return write_string_file("/run/systemd/container", c, WRITE_STRING_FILE_CREATE); } int main(int argc, char *argv[]) { diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c index ddb02a1580..cbe7d0b4a9 100644 --- a/src/core/smack-setup.c +++ b/src/core/smack-setup.c @@ -221,7 +221,7 @@ int mac_smack_setup(bool *loaded_policy) { } #ifdef SMACK_RUN_LABEL - r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL); + r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, 0); if (r) log_warning("Failed to set SMACK label \"%s\" on self: %s", SMACK_RUN_LABEL, strerror(-r)); |