From 4c1fc3e404d648c70bd2f50ac50aeac6ece8872e Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Mon, 6 Jul 2015 19:19:25 -0400 Subject: fileio: consolidate write_string_file*() Merge write_string_file(), write_string_file_no_create() and write_string_file_atomic() into write_string_file() and provide a flags mask that allows combinations of atomic writing, newline appending and automatic file creation. Change all users accordingly. --- src/network/networkd-link.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/network') diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 5607cf470e..9550e89a15 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1495,7 +1495,7 @@ static int link_set_ipv4_forward(Link *link) { p = strjoina("/proc/sys/net/ipv4/conf/", link->ifname, "/forwarding"); v = one_zero(link_ipv4_forward_enabled(link)); - r = write_string_file_no_create(p, v); + r = write_string_file(p, v, 0); if (r < 0) { /* If the right value is set anyway, don't complain */ if (verify_one_line_file(p, v) > 0) @@ -1524,7 +1524,7 @@ static int link_set_ipv6_forward(Link *link) { p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/forwarding"); v = one_zero(link_ipv6_forward_enabled(link)); - r = write_string_file_no_create(p, v); + r = write_string_file(p, v, 0); if (r < 0) { /* If the right value is set anyway, don't complain */ if (verify_one_line_file(p, v) > 0) @@ -1553,7 +1553,7 @@ static int link_set_ipv6_privacy_extensions(Link *link) { p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/use_tempaddr"); xsprintf(buf, "%u", link->network->ipv6_privacy_extensions); - r = write_string_file_no_create(p, buf); + r = write_string_file(p, buf, 0); if (r < 0) { /* If the right value is set anyway, don't complain */ if (verify_one_line_file(p, buf) > 0) -- cgit v1.2.3-54-g00ecf