]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not propagte error on stat()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 Jun 2020 07:19:50 +0000 (16:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 Jun 2020 08:03:40 +0000 (17:03 +0900)
src/network/networkd-network.c

index e8419426f2b3a761cf6719146527a61a1bc04c93..1921fe2ff36c65b41ed5a2fbc3ae46a4f0a9e3b9 100644 (file)
@@ -538,9 +538,8 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
                                   network->filename);
 
         struct stat stats;
-        if (stat(filename, &stats) < 0)
-                return -errno;
-        network->timestamp = timespec_load(&stats.st_mtim);
+        if (stat(filename, &stats) >= 0)
+                network->timestamp = timespec_load(&stats.st_mtim);
 
         if (network_verify(network) < 0)
                 /* Ignore .network files that do not match the conditions. */