]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: use open(O_EXCL) to detect if device is used
authorKarel Zak <kzak@redhat.com>
Thu, 15 Apr 2021 13:11:44 +0000 (15:11 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 15 Apr 2021 13:14:52 +0000 (15:14 +0200)
commit1c75a85101e36ebc193183733821546f0fa430fc
treed5e4f5a278fb012b7c9e6692b261318afc547512
parentdee0c29c6f9fa72a8d19c2336ea8b7f8cac2c81e
libfdisk: use open(O_EXCL) to detect if device is used

It's seems detection by BLKRRPART is broken in recent kernels
(probably regression), and it's also overkill to force kernel re-read
all and generate all the events. It seems more elegant to use O_EXCL.

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/context.c
libfdisk/src/fdiskP.h
tests/expected/fdisk/oddinput.err
tests/helpers/test_strerror.c
tests/ts/fdisk/oddinput