diff options
Diffstat (limited to 'src/udev/net/link-config.c')
-rw-r--r-- | src/udev/net/link-config.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 73243fa107..512885f9c8 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -153,11 +153,6 @@ static int load_link(link_config_ctx *ctx, const char *filename) { assert(ctx); assert(filename); - if (null_or_empty_path(filename)) { - log_debug("skipping empty file: %s", filename); - return 0; - } - file = fopen(filename, "re"); if (!file) { if (errno == ENOENT) @@ -166,6 +161,11 @@ static int load_link(link_config_ctx *ctx, const char *filename) { return -errno; } + if (null_or_empty_fd(fileno(file))) { + log_debug("Skipping empty file: %s", filename); + return 0; + } + link = new0(link_config, 1); if (!link) return log_oom(); |