]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: logs when failed to remove saved info about devlink
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Jun 2021 14:32:17 +0000 (23:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 4 Jun 2021 06:51:39 +0000 (15:51 +0900)
src/udev/udev-node.c

index 033ecc91f221d378119803e916be950cd0a71f49..1702f489d1c286559aec1698af7a31728e29b33b 100644 (file)
@@ -275,8 +275,10 @@ static int link_update(sd_device *dev, const char *slink_in, bool add) {
                 return log_oom();
 
         if (!add) {
-                if (unlink(filename) == 0)
-                        (void) rmdir(dirname);
+                if (unlink(filename) < 0 && errno != ENOENT)
+                        log_device_debug_errno(dev, errno, "Failed to remove %s, ignoring: %m", filename);
+
+                (void) rmdir(dirname);
         } else
                 for (;;) {
                         _cleanup_close_ int fd = -1;