sd-device: use fd_reopen() at one more place

It provides recognizable error if /proc is not mounted.
This commit is contained in:
Yu Watanabe
2022-09-20 09:26:50 +09:00
committed by Daan De Meyer
parent 3fab44b2ff
commit 83b94cf10e

View 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);