]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevadm: ignore -ENODEV on trigger
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 5 Oct 2020 21:39:22 +0000 (06:39 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 6 Oct 2020 06:25:54 +0000 (08:25 +0200)
The commit 88da55e28b467999da005591d3252a98f4436522 erroneously makes
`udevadm trigger` treat -ENODEV error critical.
This makes -ENODEV ignored again.

Fixes #17250.

src/udev/udevadm-trigger.c

index 0da4ea787b0d4554e31894f268cc10353619b931..a588d18fd117b1637af09f7729adf66b902072f5 100644 (file)
@@ -45,12 +45,12 @@ static int exec_list(sd_device_enumerator *e, const char *action, Set **settle_s
 
                 r = write_string_file(filename, action, WRITE_STRING_FILE_DISABLE_BUFFER);
                 if (r < 0) {
-                        bool ignore = r == -ENOENT;
+                        bool ignore = IN_SET(r, -ENOENT, -ENODEV);
 
                         log_full_errno(ignore ? LOG_DEBUG : LOG_ERR, r,
                                        "Failed to write '%s' to '%s'%s: %m",
                                        action, filename, ignore ? ", ignoring" : "");
-                        if (IN_SET(r, -EACCES, -ENODEV, -EROFS))
+                        if (IN_SET(r, -EACCES, -EROFS))
                                 /* Inovoked by unpriviledged user, or read only filesystem. Return earlier. */
                                 return r;
                         if (ret == 0 && !ignore)