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

This commit is contained in:
Tom Gundersen
2014-04-19 19:05:37 +02:00
parent a21df10488
commit 6916ec29af
3 changed files with 15 additions and 0 deletions
+5
View File
@@ -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)
+5
View File
@@ -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();
+5
View File
@@ -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)