[systemd-commits] src/timesync

Kay Sievers kay at kemper.freedesktop.org
Tue May 20 18:42:50 PDT 2014


 src/timesync/timesyncd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a6cb8f870d68654a4297b8cb859068bca8e0f44c
Author: Kay Sievers <kay at vrfy.org>
Date:   Wed May 21 10:35:17 2014 +0900

    timesyncd: use STR_IN_SET()

diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index b13db1a..54da88b 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -1146,10 +1146,10 @@ static bool network_is_online(void) {
         int r;
 
         r = sd_network_get_operational_state(&state);
-        if (r >= 0 && (streq("routable", state) || streq("degraded", state)))
+        if (r >= 0 && STR_IN_SET(state, "routable", "degraded"))
                 return true;
-        else
-                return false;
+
+        return false;
 }
 
 static int manager_network_event_handler(sd_event_source *s, int fd, uint32_t revents,



More information about the systemd-commits mailing list