From f2d251cdb8f8318666599fc47ee506c59b274ce0 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 25 Feb 2019 11:48:39 +0900 Subject: [PATCH] udev/net: shorten load_link() a little bit --- src/udev/net/link-config.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index b54090046e..b48e423422 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -126,12 +126,8 @@ static int load_link(link_config_ctx *ctx, const char *filename) { assert(filename); file = fopen(filename, "re"); - if (!file) { - if (errno == ENOENT) - return 0; - else - return -errno; - } + if (!file) + return errno == ENOENT ? 0 : -errno; if (null_or_empty_fd(fileno(file))) { log_debug("Skipping empty file: %s", filename);