Merge pull request #23675 from enr0n/udev-available-cleanup

Use udev_available() where appropriate
This commit is contained in:
Yu Watanabe 2022-06-09 12:12:01 +09:00 committed by GitHub
commit adf59bffe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -11,7 +11,6 @@
#include "netif-util.h"
#include "siphash24.h"
#include "sparse-endian.h"
#include "stat-util.h"
#include "string-table.h"
#include "udev-util.h"
@ -213,7 +212,7 @@ int dhcp_identifier_set_iaid(
uint64_t id;
int r;
if (path_is_read_only_fs("/sys") <= 0 && !use_mac) {
if (udev_available() && !use_mac) {
/* udev should be around */
r = sd_device_new_from_ifindex(&device, ifindex);

View file

@ -468,7 +468,7 @@ int test_network_interface_initialized(const char *name) {
_cleanup_(sd_device_unrefp) sd_device *d = NULL;
int r;
if (path_is_read_only_fs("/sys") > 0)
if (!udev_available())
return 0;
/* udev should be around. */