diff options
Diffstat (limited to 'poky/meta/recipes-core/systemd/systemd/0022-do-not-disable-buffer-in-writing-files.patch')
-rw-r--r-- | poky/meta/recipes-core/systemd/systemd/0022-do-not-disable-buffer-in-writing-files.patch | 131 |
1 files changed, 70 insertions, 61 deletions
diff --git a/poky/meta/recipes-core/systemd/systemd/0022-do-not-disable-buffer-in-writing-files.patch b/poky/meta/recipes-core/systemd/systemd/0022-do-not-disable-buffer-in-writing-files.patch index bd627c51e..6998bf0dd 100644 --- a/poky/meta/recipes-core/systemd/systemd/0022-do-not-disable-buffer-in-writing-files.patch +++ b/poky/meta/recipes-core/systemd/systemd/0022-do-not-disable-buffer-in-writing-files.patch @@ -1,4 +1,4 @@ -From 7cb6579572b50ef44bc0a321a4c73cce55b0c2f2 Mon Sep 17 00:00:00 2001 +From 3198690c2dbb4b457a04ef21914dc4d531540273 Mon Sep 17 00:00:00 2001 From: Chen Qi <Qi.Chen@windriver.com> Date: Fri, 1 Mar 2019 15:22:15 +0800 Subject: [PATCH] do not disable buffer in writing files @@ -22,7 +22,6 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com> --- src/basic/cgroup-util.c | 10 +++++----- src/basic/procfs-util.c | 4 ++-- - src/basic/smack-util.c | 2 +- src/basic/sysctl-util.c | 2 +- src/basic/util.c | 2 +- src/binfmt/binfmt.c | 6 +++--- @@ -30,19 +29,20 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com> src/core/smack-setup.c | 8 ++++---- src/hibernate-resume/hibernate-resume.c | 2 +- src/libsystemd/sd-device/sd-device.c | 2 +- - src/login/logind-dbus.c | 2 +- src/nspawn/nspawn-cgroup.c | 2 +- src/nspawn/nspawn.c | 6 +++--- src/shared/cgroup-setup.c | 4 ++-- + src/shared/mount-util.c | 4 ++-- + src/shared/smack-util.c | 2 +- src/sleep/sleep.c | 8 ++++---- src/vconsole/vconsole-setup.c | 2 +- - 16 files changed, 33 insertions(+), 33 deletions(-) + 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c -index 50c1ae1b2b..5b40e92163 100644 +index c9efd862a2..b3708ea925 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c -@@ -765,7 +765,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { +@@ -766,7 +766,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { sc = strstrip(contents); if (isempty(sc)) { @@ -51,7 +51,7 @@ index 50c1ae1b2b..5b40e92163 100644 if (r < 0) return r; } else if (!path_equal(sc, agent)) -@@ -783,7 +783,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { +@@ -784,7 +784,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { sc = strstrip(contents); if (streq(sc, "0")) { @@ -60,7 +60,7 @@ index 50c1ae1b2b..5b40e92163 100644 if (r < 0) return r; -@@ -810,7 +810,7 @@ int cg_uninstall_release_agent(const char *controller) { +@@ -811,7 +811,7 @@ int cg_uninstall_release_agent(const char *controller) { if (r < 0) return r; @@ -69,7 +69,7 @@ index 50c1ae1b2b..5b40e92163 100644 if (r < 0) return r; -@@ -820,7 +820,7 @@ int cg_uninstall_release_agent(const char *controller) { +@@ -821,7 +821,7 @@ int cg_uninstall_release_agent(const char *controller) { if (r < 0) return r; @@ -78,7 +78,7 @@ index 50c1ae1b2b..5b40e92163 100644 if (r < 0) return r; -@@ -1650,7 +1650,7 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri +@@ -1651,7 +1651,7 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri if (r < 0) return r; @@ -88,7 +88,7 @@ index 50c1ae1b2b..5b40e92163 100644 int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) { diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c -index 8f9eee8d36..480f8cc0b4 100644 +index 8c57094225..0cf6ec752b 100644 --- a/src/basic/procfs-util.c +++ b/src/basic/procfs-util.c @@ -86,13 +86,13 @@ int procfs_tasks_set_limit(uint64_t limit) { @@ -107,21 +107,8 @@ index 8f9eee8d36..480f8cc0b4 100644 if (r < 0) { uint64_t threads_max; -diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c -index 3362ee3924..80c0f2a52e 100644 ---- a/src/basic/smack-util.c -+++ b/src/basic/smack-util.c -@@ -114,7 +114,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_DISABLE_BUFFER); -+ r = write_string_file(p, label, 0); - if (r < 0) - return r; - diff --git a/src/basic/sysctl-util.c b/src/basic/sysctl-util.c -index c96b5cd77f..d2476d9665 100644 +index 8913e6ff85..29e6ec0755 100644 --- a/src/basic/sysctl-util.c +++ b/src/basic/sysctl-util.c @@ -93,7 +93,7 @@ int sysctl_write_ip_property(int af, const char *ifname, const char *property, c @@ -147,7 +134,7 @@ index 955b18bd2a..6d89c90176 100644 log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m"); } diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c -index f6b72e0bae..e9fd4d06be 100644 +index 29530bb691..3ecf6a45a2 100644 --- a/src/binfmt/binfmt.c +++ b/src/binfmt/binfmt.c @@ -48,7 +48,7 @@ static int delete_rule(const char *rule) { @@ -168,7 +155,7 @@ index f6b72e0bae..e9fd4d06be 100644 if (r < 0) return log_error_errno(r, "Failed to add binary format: %m"); -@@ -222,7 +222,7 @@ static int run(int argc, char *argv[]) { +@@ -223,7 +223,7 @@ static int run(int argc, char *argv[]) { } /* Flush out all rules */ @@ -178,10 +165,10 @@ index f6b72e0bae..e9fd4d06be 100644 STRV_FOREACH(f, files) { k = apply_file(*f, true); diff --git a/src/core/main.c b/src/core/main.c -index 3ee8d0a869..ec36e3e80f 100644 +index b32a19a1d8..4e1238853e 100644 --- a/src/core/main.c +++ b/src/core/main.c -@@ -1401,7 +1401,7 @@ static int bump_unix_max_dgram_qlen(void) { +@@ -1402,7 +1402,7 @@ static int bump_unix_max_dgram_qlen(void) { if (v >= DEFAULT_UNIX_MAX_DGRAM_QLEN) return 0; @@ -190,7 +177,7 @@ index 3ee8d0a869..ec36e3e80f 100644 if (r < 0) return log_full_errno(IN_SET(r, -EROFS, -EPERM, -EACCES) ? LOG_DEBUG : LOG_WARNING, r, "Failed to bump AF_UNIX datagram queue length, ignoring: %m"); -@@ -1678,7 +1678,7 @@ static void initialize_core_pattern(bool skip_setup) { +@@ -1679,7 +1679,7 @@ static void initialize_core_pattern(bool skip_setup) { if (getpid_cached() != 1) return; @@ -200,10 +187,10 @@ index 3ee8d0a869..ec36e3e80f 100644 log_warning_errno(r, "Failed to write '%s' to /proc/sys/kernel/core_pattern, ignoring: %m", arg_early_core_pattern); } diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c -index 8cc1696a4f..ab7b4ba2c3 100644 +index 79c4808473..b111ce0a11 100644 --- a/src/core/smack-setup.c +++ b/src/core/smack-setup.c -@@ -325,17 +325,17 @@ int mac_smack_setup(bool *loaded_policy) { +@@ -323,17 +323,17 @@ int mac_smack_setup(bool *loaded_policy) { } #ifdef SMACK_RUN_LABEL @@ -239,10 +226,10 @@ index 58e35e403e..1d0beb4008 100644 log_error_errno(r, "Failed to write '%s' to /sys/power/resume: %m", major_minor); return EXIT_FAILURE; diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c -index d82f01a164..b8fd63346c 100644 +index 388128bf33..695f535ff4 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c -@@ -1987,7 +1987,7 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, +@@ -2096,7 +2096,7 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, if (!value) return -ENOMEM; @@ -251,19 +238,6 @@ index d82f01a164..b8fd63346c 100644 if (r < 0) { /* On failure, clear cache entry, as we do not know how it fails. */ device_remove_cached_sysattr_value(device, sysattr); -diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c -index 3bc424b83b..5f5eef0843 100644 ---- a/src/login/logind-dbus.c -+++ b/src/login/logind-dbus.c -@@ -1330,7 +1330,7 @@ static int trigger_device(Manager *m, sd_device *d) { - if (!t) - return -ENOMEM; - -- (void) write_string_file(t, "change", WRITE_STRING_FILE_DISABLE_BUFFER); -+ (void) write_string_file(t, "change", 0); - } - - return 0; diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c index cb01b25bc6..e92051268b 100644 --- a/src/nspawn/nspawn-cgroup.c @@ -278,10 +252,10 @@ index cb01b25bc6..e92051268b 100644 log_error_errno(r, "Failed to move process: %m"); goto finish; diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c -index 0c41a48d4b..9c893b18e4 100644 +index 90b12bb5bd..6a1dafa094 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c -@@ -2695,7 +2695,7 @@ static int reset_audit_loginuid(void) { +@@ -2751,7 +2751,7 @@ static int reset_audit_loginuid(void) { if (streq(p, "4294967295")) return 0; @@ -290,19 +264,21 @@ index 0c41a48d4b..9c893b18e4 100644 if (r < 0) { log_error_errno(r, "Failed to reset audit login UID. This probably means that your kernel is too\n" -@@ -3948,13 +3948,13 @@ static int setup_uid_map(pid_t pid) { +@@ -4148,7 +4148,7 @@ static int setup_uid_map( + return log_oom(); xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid); - xsprintf(line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0, arg_uid_shift, arg_uid_range); -- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER); -+ r = write_string_file(uid_map, line, 0); +- r = write_string_file(uid_map, s, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file(uid_map, s, 0); if (r < 0) return log_error_errno(r, "Failed to write UID map: %m"); - /* We always assign the same UID and GID ranges */ +@@ -4158,7 +4158,7 @@ static int setup_uid_map( + return log_oom(); + xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid); -- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER); -+ r = write_string_file(uid_map, line, 0); +- r = write_string_file(uid_map, s, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file(uid_map, s, 0); if (r < 0) return log_error_errno(r, "Failed to write GID map: %m"); @@ -328,11 +304,44 @@ index f197f715c7..077f893177 100644 if (r < 0) { log_debug_errno(r, "Failed to %s controller %s for %s (%s): %m", FLAGS_SET(mask, bit) ? "enable" : "disable", n, p, fs); +diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c +index 594efea989..d243b45bc4 100644 +--- a/src/shared/mount-util.c ++++ b/src/shared/mount-util.c +@@ -1019,13 +1019,13 @@ static int make_userns(uid_t uid_shift, uid_t uid_range) { + xsprintf(line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0, uid_shift, uid_range); + + xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid); +- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file(uid_map, line, 0); + if (r < 0) + return log_error_errno(r, "Failed to write UID map: %m"); + + /* We always assign the same UID and GID ranges */ + xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid); +- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file(uid_map, line, 0); + if (r < 0) + return log_error_errno(r, "Failed to write GID map: %m"); + +diff --git a/src/shared/smack-util.c b/src/shared/smack-util.c +index 3362ee3924..80c0f2a52e 100644 +--- a/src/shared/smack-util.c ++++ b/src/shared/smack-util.c +@@ -114,7 +114,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_DISABLE_BUFFER); ++ r = write_string_file(p, label, 0); + if (r < 0) + return r; + diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c -index 262d4cea66..0523e8dc9b 100644 +index a3aeb24633..d3e68e1b94 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c -@@ -48,7 +48,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca +@@ -46,7 +46,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca assert(hibernate_location->swap); xsprintf(resume_str, "%u:%u", major(hibernate_location->devno), minor(hibernate_location->devno)); @@ -341,7 +350,7 @@ index 262d4cea66..0523e8dc9b 100644 if (r < 0) return log_debug_errno(r, "Failed to write partition device to /sys/power/resume for '%s': '%s': %m", hibernate_location->swap->device, resume_str); -@@ -75,7 +75,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca +@@ -73,7 +73,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca } xsprintf(offset_str, "%" PRIu64, hibernate_location->offset); @@ -350,7 +359,7 @@ index 262d4cea66..0523e8dc9b 100644 if (r < 0) return log_debug_errno(r, "Failed to write swap file offset to /sys/power/resume_offset for '%s': '%s': %m", hibernate_location->swap->device, offset_str); -@@ -92,7 +92,7 @@ static int write_mode(char **modes) { +@@ -90,7 +90,7 @@ static int write_mode(char **modes) { STRV_FOREACH(mode, modes) { int k; @@ -359,7 +368,7 @@ index 262d4cea66..0523e8dc9b 100644 if (k >= 0) return 0; -@@ -114,7 +114,7 @@ static int write_state(FILE **f, char **states) { +@@ -112,7 +112,7 @@ static int write_state(FILE **f, char **states) { STRV_FOREACH(state, states) { int k; |