udev/net: shorten load_link() a little bit

This commit is contained in:
Yu Watanabe
2019-02-25 11:48:39 +09:00
parent c6b3370ab2
commit f2d251cdb8
+2 -6
View 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);