mirror of
https://github.com/systemd/systemd.git
synced 2024-10-31 16:21:26 +03:00
network: use conservative_rename() to reduce to trigger network events
networkd part to fix #17577.
Note resolved part is f3e1f00d03
.
This commit is contained in:
parent
10195179bb
commit
af664001f5
@ -16,6 +16,7 @@
|
||||
#include "ethtool-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "ipvlan.h"
|
||||
#include "missing_network.h"
|
||||
#include "netlink-util.h"
|
||||
@ -3175,10 +3176,9 @@ int link_save(Link *link) {
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
|
||||
if (rename(temp_path, link->state_file) < 0) {
|
||||
r = -errno;
|
||||
r = conservative_rename(temp_path, link->state_file);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "firewall-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "local-addresses.h"
|
||||
#include "netlink-util.h"
|
||||
#include "network-internal.h"
|
||||
@ -709,10 +710,9 @@ static int manager_save(Manager *m) {
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
|
||||
if (rename(temp_path, m->state_file) < 0) {
|
||||
r = -errno;
|
||||
r = conservative_rename(temp_path, m->state_file);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (m->operational_state != operstate) {
|
||||
m->operational_state = operstate;
|
||||
|
Loading…
Reference in New Issue
Block a user