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/udev | |
parent | 380aea0c5ba373df9fe37bdf0404442bd9034b92 (diff) | |
parent | ad118bda159d3f9c27c5a15ace54cf808a6e8788 (diff) |
Merge pull request #500 from zonque/fileio
fileio: consolidate write_string_file*()
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udevd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index e27fb1fd9e..0661f7be00 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -398,7 +398,7 @@ static void worker_spawn(Manager *manager, struct event *event) { prctl(PR_SET_PDEATHSIG, SIGTERM); /* reset OOM score, we only protect the main daemon */ - write_string_file("/proc/self/oom_score_adj", "0"); + write_string_file("/proc/self/oom_score_adj", "0", 0); for (;;) { struct udev_event *udev_event; @@ -1091,7 +1091,7 @@ static int synthesize_change(struct udev_device *dev) { */ log_debug("device %s closed, synthesising 'change'", udev_device_get_devnode(dev)); strscpyl(filename, sizeof(filename), udev_device_get_syspath(dev), "/uevent", NULL); - write_string_file(filename, "change"); + write_string_file(filename, "change", WRITE_STRING_FILE_CREATE); udev_list_entry_foreach(item, udev_enumerate_get_list_entry(e)) { _cleanup_udev_device_unref_ struct udev_device *d = NULL; @@ -1106,7 +1106,7 @@ static int synthesize_change(struct udev_device *dev) { log_debug("device %s closed, synthesising partition '%s' 'change'", udev_device_get_devnode(dev), udev_device_get_devnode(d)); strscpyl(filename, sizeof(filename), udev_device_get_syspath(d), "/uevent", NULL); - write_string_file(filename, "change"); + write_string_file(filename, "change", WRITE_STRING_FILE_CREATE); } return 0; @@ -1114,7 +1114,7 @@ static int synthesize_change(struct udev_device *dev) { log_debug("device %s closed, synthesising 'change'", udev_device_get_devnode(dev)); strscpyl(filename, sizeof(filename), udev_device_get_syspath(dev), "/uevent", NULL); - write_string_file(filename, "change"); + write_string_file(filename, "change", WRITE_STRING_FILE_CREATE); return 0; } @@ -1747,7 +1747,7 @@ int main(int argc, char *argv[]) { setsid(); - write_string_file("/proc/self/oom_score_adj", "-1000"); + write_string_file("/proc/self/oom_score_adj", "-1000", 0); } r = run(fd_ctrl, fd_uevent, cgroup); |