[systemd-devel] [PATCH] silence warning

Thomas H.P. Andersen phomes at gmail.com
Fri Apr 11 13:17:39 PDT 2014


From: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>

The error message logged in finish: will not be very informative
but on the other hand I don't see how this should ever happen.
---
 src/network/networkd-link.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 684e1e5..e9b30a3 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1518,8 +1518,10 @@ int link_save(Link *link) {
         assert(link->state_file);
 
         state = link_state_to_string(link->state);
-        if (!state)
+        if (!state) {
+                r = -EINVAL;
                 goto finish;
+        }
 
         r = fopen_temporary(link->state_file, &f, &temp_path);
         if (r < 0)
-- 
1.9.0



More information about the systemd-devel mailing list