]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev/net: shorten load_link() a little bit
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Feb 2019 02:48:39 +0000 (11:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Feb 2019 02:48:39 +0000 (11:48 +0900)
src/udev/net/link-config.c

index b54090046e71a826357882bc83f377e973368e8e..b48e423422d62069a3085525813b68941bda512d 100644 (file)
@@ -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);