From: Yu Watanabe Date: Thu, 17 Feb 2022 09:55:24 +0000 (+0900) Subject: network: use udev_available() where applicable X-Git-Tag: v251-rc1~269^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=82f52245baa2fe26f1de7b50a036d3746deb7df1;p=thirdparty%2Fsystemd.git network: use udev_available() where applicable --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 238b68579c5..5706174f5be 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -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 */ diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 553aa2beb1e..2453c33259d 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -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);