]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: return ENODEV if link_directory_read_one() can't find the devnode
authorFranck Bui <fbui@suse.com>
Tue, 3 Jan 2023 16:38:59 +0000 (17:38 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 13 Jan 2023 02:22:31 +0000 (11:22 +0900)
That's usually the errno code we return when a device cannot be found because
it's been unplugged.

src/udev/udev-node.c

index 47761289334bfbe329f1e0193527306119728ca1..e1e1695050988f58fe50929dbde2862825bb0ec7 100644 (file)
@@ -133,7 +133,7 @@ static int stack_directory_read_one(int dirfd, const char *id, bool is_symlink,
                  * symlink will be removed during processing the event. The check is just for shortening the
                  * timespan that the symlink points to a non-existing device node. */
                 if (access(colon + 1, F_OK) < 0)
-                        return -errno;
+                        return -ENODEV;
 
                 r = safe_atoi(buf, &tmp_prio);
                 if (r < 0)