From: Yu Watanabe Date: Wed, 2 Jun 2021 14:32:17 +0000 (+0900) Subject: udev: logs when failed to remove saved info about devlink X-Git-Tag: v249-rc1~91^2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=286bedd7a45b6dc82479351a2445e6b75263b47c;p=thirdparty%2Fsystemd.git udev: logs when failed to remove saved info about devlink --- diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index 033ecc91f22..1702f489d1c 100644 --- a/src/udev/udev-node.c +++ b/src/udev/udev-node.c @@ -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;