]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/blkdev: add open_blkdev_or_file() function
authorSami Kerola <kerolasa@iki.fi>
Sat, 31 Oct 2015 17:29:02 +0000 (17:29 +0000)
committerSami Kerola <kerolasa@iki.fi>
Sun, 22 Nov 2015 20:56:05 +0000 (20:56 +0000)
commit8fe1e638fa81d88e1e405f6221c7a592284c9b23
tree7b95d5f7c2276f0ccdc5e24d97b5343d942b0d08
parent3f684db0d93a86b3e9525c57e65a5b281c792a2e
lib/blkdev: add open_blkdev_or_file() function

Purpose of this function is to open a path that is potentially pointing to a
block device or file without races.  The function also proper open(3) flags
are used to check the device is not busy, and finally warning is been
printed if a block device happens to be misaligned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/blkdev.h
lib/blkdev.c