]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: use fd_reopen() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 20 Sep 2022 00:26:50 +0000 (09:26 +0900)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 20 Sep 2022 07:41:34 +0000 (09:41 +0200)
It provides recognizable error if /proc is not mounted.

src/libsystemd/sd-device/sd-device.c

index 7e3d5eeae121eede5f77046bd1cb620508ad4391..9364a69dcd00d7283ed6243d099779db81528db1 100644 (file)
@@ -2442,9 +2442,9 @@ _public_ int sd_device_open(sd_device *device, int flags) {
                 }
         }
 
-        fd2 = open(FORMAT_PROC_FD_PATH(fd), flags);
+        fd2 = fd_reopen(fd, flags);
         if (fd2 < 0)
-                return -errno;
+                return fd2;
 
         if (diskseq == 0)
                 return TAKE_FD(fd2);