diff options
Diffstat (limited to 'src/network/networkd-netdev.c')
-rw-r--r-- | src/network/networkd-netdev.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c index 9974913f49..8b96d60dca 100644 --- a/src/network/networkd-netdev.c +++ b/src/network/networkd-netdev.c @@ -495,11 +495,6 @@ static int netdev_load_one(Manager *manager, const char *filename) { assert(manager); 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) @@ -508,6 +503,11 @@ static int netdev_load_one(Manager *manager, const char *filename) { return -errno; } + if (null_or_empty_fd(fileno(file))) { + log_debug("Skipping empty file: %s", filename); + return 0; + } + netdev = new0(NetDev, 1); if (!netdev) return log_oom(); |