summaryrefslogtreecommitdiffstats
path: root/src/nspawn/nspawn-network.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-10-29 09:32:21 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-10-29 09:33:33 +0100
commit5a937ea2f66ced76dcaa2075382c041998110185 (patch)
treeed8ba4122fb77bdfd44a24355d2f66d45932f6f2 /src/nspawn/nspawn-network.c
parentsd-device: make several sd_device_get_*() accepts NULL pointer for buffer of ... (diff)
downloadsystemd-5a937ea2f66ced76dcaa2075382c041998110185.tar.xz
systemd-5a937ea2f66ced76dcaa2075382c041998110185.zip
sd-device: make sd_device_get_is_initialized() returns is_initialized by return value
Diffstat (limited to 'src/nspawn/nspawn-network.c')
-rw-r--r--src/nspawn/nspawn-network.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nspawn/nspawn-network.c b/src/nspawn/nspawn-network.c
index 997609bb8e..214fa40804 100644
--- a/src/nspawn/nspawn-network.c
+++ b/src/nspawn/nspawn-network.c
@@ -395,7 +395,7 @@ int remove_bridge(const char *bridge_name) {
static int parse_interface(const char *name) {
_cleanup_(sd_device_unrefp) sd_device *d = NULL;
char ifi_str[2 + DECIMAL_STR_MAX(int)];
- int ifi, initialized, r;
+ int ifi, r;
ifi = (int) if_nametoindex(name);
if (ifi <= 0)
@@ -406,11 +406,10 @@ static int parse_interface(const char *name) {
if (r < 0)
return log_error_errno(r, "Failed to get device for interface %s: %m", name);
- r = sd_device_get_is_initialized(d, &initialized);
+ r = sd_device_get_is_initialized(d);
if (r < 0)
return log_error_errno(r, "Failed to determine whether interface %s is initialized or not: %m", name);
-
- if (!initialized) {
+ if (r == 0) {
log_error("Network interface %s is not initialized yet.", name);
return -EBUSY;
}