summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-netdev.c5
-rw-r--r--src/network/networkd-network.c5
-rw-r--r--src/udev/net/link-config.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index 717ecdf0e5..d503058e59 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -475,6 +475,11 @@ 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)
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 048017e229..4d01e55fee 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -44,6 +44,11 @@ static int network_load_one(Manager *manager, const char *filename) {
return -errno;
}
+ if (null_or_empty_path(filename)) {
+ log_debug("skipping empty file: %s", filename);
+ return 0;
+ }
+
network = new0(Network, 1);
if (!network)
return log_oom();
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 8215c40d5d..345a380d85 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -146,6 +146,11 @@ 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)