marsadm: correct wrong condition for checking exclusive access

The fixed bug was introduced in commit:

marsadm: 'create-resource' --force no longer checks for exclusive access
This commit is contained in:
Frank Liepold 2013-07-25 09:12:46 +02:00
parent 2e441d0d11
commit e3db28c4d7
1 changed files with 1 additions and 1 deletions

View File

@ -865,7 +865,7 @@ sub create_res {
ldie "block device '$dev' must be an absolute path starting with '/'\n" unless $dev =~ m/^\//;
use Fcntl 'SEEK_END', 'O_RDONLY', 'O_RDWR', 'O_EXCL';
my $flags = O_RDWR | O_EXCL;
if (!$force) {
if ($force) {
$flags = O_RDONLY;
}
sysopen(TEST, $dev, $flags) or ldie "cannot open device '$dev' for exclusive rw access\n";