[systemd-commits] src/network src/udev

Tom Gundersen tomegun at kemper.freedesktop.org
Sat Apr 19 10:08:58 PDT 2014


 src/network/networkd-netdev.c  |    5 +++++
 src/network/networkd-network.c |    5 +++++
 src/udev/net/link-config.c     |    5 +++++
 3 files changed, 15 insertions(+)

New commits:
commit 6916ec29afd488d91e7e0fcbcc2e006b4e5f28df
Author: Tom Gundersen <teg at jklm.no>
Date:   Sat Apr 19 19:05:37 2014 +0200

    network: implement masking of .link, .network and .netdev files

diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index 717ecdf..d503058 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 048017e..4d01e55 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 8215c40..345a380 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)



More information about the systemd-commits mailing list