mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-01-23 15:39:28 +07:00
udev: guard REREADPT by exclusive lock instead of O_EXCL
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This commit is contained in:
parent
eb666fd898
commit
0c693f06e3
@ -755,9 +755,12 @@ static int synthesize_change(struct udev_device *dev) {
|
||||
* partition table is found, and we will not get an event for
|
||||
* the disk.
|
||||
*/
|
||||
fd = open(udev_device_get_devnode(dev), O_RDONLY|O_EXCL|O_CLOEXEC|O_NOFOLLOW|O_NONBLOCK);
|
||||
fd = open(udev_device_get_devnode(dev), O_RDONLY|O_CLOEXEC|O_NOFOLLOW|O_NONBLOCK);
|
||||
if (fd >= 0) {
|
||||
r = ioctl(fd, BLKRRPART, 0);
|
||||
r = flock(fd, LOCK_EX|LOCK_NB);
|
||||
if (r >= 0)
|
||||
r = ioctl(fd, BLKRRPART, 0);
|
||||
|
||||
close(fd);
|
||||
if (r >= 0)
|
||||
part_table_read = true;
|
||||
|
Loading…
Reference in New Issue
Block a user