]> git.ipfire.org Git - thirdparty/util-linux.git/commit - libblkid/src/evaluate.c
libblkid: open device in nonblock mode.
authorMichal Suchanek <msuchanek@suse.de>
Mon, 4 Nov 2019 20:23:15 +0000 (21:23 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Nov 2019 08:55:49 +0000 (09:55 +0100)
commit39f5af25982d8b0244000e92a9d0e0e6557d0e17
tree07d1da5ce1bf0900da3dfa978cc388064f5025c8
parentb4402de7a0918c68d2cef76802074ddde2d8711c
libblkid: open device in nonblock mode.

When autoclose is set (kernel default but many distributions reverse the
setting) opening a CD-rom device causes the tray to close.

The function of blkid is to report the current state of the device and
not to change it. Hence it should use O_NONBLOCK when opening the
device to avoid closing a CD-rom tray.

blkid is used liberally in scripts so it can potentially interfere with
the user operating the CD-rom hardware.

[kzak@redhat.com: add O_NONBLOCK also to:
                  - wipefs
                  - blkid_new_probe_from_filename()
                  - blkid_evaluate_tag()]

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/evaluate.c
libblkid/src/probe.c
libblkid/src/verify.c
misc-utils/blkid.c
misc-utils/wipefs.c