ifupdown: rewrite state file atomically
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 9 Oct 2016 21:04:16 +0000 (23:04 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 9 Oct 2016 21:04:16 +0000 (23:04 +0200)
commit3720a61daf2e03e42e34902c2636ce3e3d6b8485
tree6208f33c94578dbfaf39b5b108f7745190bb2c3b
parentec1ea16337623824e3e71bb5dc0e011259664d7e
ifupdown: rewrite state file atomically

By user's request.
Decided to not use fcntl(F_SETLKW) in lieu of problems with locking
on networked filesystems. The existence of /var/run/ifstate.new
is treated as a write lock. rename() provides atomicity.

function                                             old     new   delta
ifupdown_main                                       1019    1122    +103

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/ifupdown.c