]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: use udev_available() where applicable
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 17 Feb 2022 09:55:24 +0000 (18:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 17 Feb 2022 09:55:43 +0000 (18:55 +0900)
src/network/networkd-link.c
src/network/networkd-manager.c

index 238b68579c5b72f415dc2dc9afdeb3963fce393e..5706174f5be03b1f6143aff123b3bd2d9cb31129 100644 (file)
@@ -59,7 +59,6 @@
 #include "networkd-sysctl.h"
 #include "set.h"
 #include "socket-util.h"
-#include "stat-util.h"
 #include "stdio-util.h"
 #include "string-table.h"
 #include "strv.h"
@@ -1451,8 +1450,7 @@ static int link_check_initialized(Link *link) {
 
         assert(link);
 
-        if (path_is_read_only_fs("/sys") > 0)
-                /* no udev */
+        if (!udev_available())
                 return link_initialized_and_synced(link);
 
         /* udev should be around */
index 553aa2beb1eb3835d6bba62df83aa4fe8a94e657..2453c33259db409534c456acd56ca1f2efe39732 100644 (file)
@@ -55,6 +55,7 @@
 #include "sysctl-util.h"
 #include "tclass.h"
 #include "tmpfile-util.h"
+#include "udev-util.h"
 
 /* use 128 MB for receive socket kernel queue. */
 #define RCVBUF_SIZE    (128*1024*1024)
@@ -172,7 +173,7 @@ static int manager_connect_udev(Manager *m) {
 
         /* udev does not initialize devices inside containers, so we rely on them being already
          * initialized before entering the container. */
-        if (path_is_read_only_fs("/sys") > 0)
+        if (!udev_available())
                 return 0;
 
         r = sd_device_monitor_new(&m->device_monitor);