diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-10 21:48:10 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-11 19:05:08 +0100 |
commit | b3f9c17a6b361bf98e79a0228cdcb09afc40d1cc (patch) | |
tree | 1c607970840370d1588f41eb5e6387a240e08661 /src/network/networkd-manager.c | |
parent | tree-wide: propagate error in xxx_from-string() (diff) | |
download | systemd-b3f9c17a6b361bf98e79a0228cdcb09afc40d1cc.tar.xz systemd-b3f9c17a6b361bf98e79a0228cdcb09afc40d1cc.zip |
tree-wide: use free_and_strdup_warn()
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r-- | src/network/networkd-manager.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 0e00cde87a..d7e0662453 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -1178,8 +1178,9 @@ int manager_set_hostname(Manager *m, const char *hostname) { log_debug("Setting transient hostname: '%s'", strna(hostname)); - if (free_and_strdup(&m->dynamic_hostname, hostname) < 0) - return log_oom(); + r = free_and_strdup_warn(&m->dynamic_hostname, hostname); + if (r < 0) + return r; if (!m->bus || sd_bus_is_ready(m->bus) <= 0) { log_debug("Not connected to system bus, setting hostname later."); @@ -1227,8 +1228,9 @@ int manager_set_timezone(Manager *m, const char *tz) { assert(tz); log_debug("Setting system timezone: '%s'", tz); - if (free_and_strdup(&m->dynamic_timezone, tz) < 0) - return log_oom(); + r = free_and_strdup_warn(&m->dynamic_timezone, tz); + if (r < 0) + return r; if (!m->bus || sd_bus_is_ready(m->bus) <= 0) { log_debug("Not connected to system bus, setting timezone later."); |