From bbf7c04821a71fec67eaf0e7a34d17afc5913c13 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 8 May 2014 17:21:37 +0200 Subject: sd-network: expose global operational state --- src/network/networkd-link.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/network/networkd-link.c') diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 04b2265610..ab3158356a 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1117,7 +1117,7 @@ static int link_acquire_conf(Link *link) { return 0; } -static bool link_has_carrier(unsigned flags, uint8_t operstate) { +bool link_has_carrier(unsigned flags, uint8_t operstate) { /* see Documentation/networking/operstates.txt in the kernel sources */ if (operstate == IF_OPER_UP) @@ -1689,6 +1689,11 @@ int link_save(Link *link) { assert(link); assert(link->state_file); + assert(link->manager); + + r = manager_save(link->manager); + if (r < 0) + return r; admin_state = link_state_to_string(link->state); assert(admin_state); @@ -1735,7 +1740,7 @@ int link_save(Link *link) { finish: if (r < 0) - log_error("Failed to save link data %s: %s", link->state_file, strerror(-r)); + log_error("Failed to save link data to %s: %s", link->state_file, strerror(-r)); return r; } -- cgit v1.2.3-54-g00ecf