From: Yu Watanabe Date: Wed, 3 Mar 2021 07:34:51 +0000 (+0900) Subject: network: use conservative_rename() at one more place X-Git-Tag: v248-rc3~67^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5288861bf6c167e12a08ecd1ec56be51788cfc84;p=thirdparty%2Fsystemd.git network: use conservative_rename() at one more place --- diff --git a/src/network/networkd-lldp-rx.c b/src/network/networkd-lldp-rx.c index 76ff3689e17..068adca5711 100644 --- a/src/network/networkd-lldp-rx.c +++ b/src/network/networkd-lldp-rx.c @@ -6,6 +6,7 @@ #include "fd-util.h" #include "fileio.h" +#include "fs-util.h" #include "networkd-link.h" #include "networkd-lldp-rx.h" #include "networkd-lldp-tx.h" @@ -181,10 +182,9 @@ int link_lldp_save(Link *link) { if (r < 0) goto finish; - if (rename(temp_path, link->lldp_file) < 0) { - r = -errno; + r = conservative_rename(temp_path, link->lldp_file); + if (r < 0) goto finish; - } finish: if (r < 0) {