dev_open should always open read-only.

When opening an array to manipulate it we never need to write to the
array and  sometimes it might be read-only so the open for write will
fail.
So always open read-only.

Reported-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-03-10 11:41:21 +11:00
parent b8b8eda804
commit 82a7851e5f
1 changed files with 1 additions and 1 deletions

2
util.c
View File

@ -1003,7 +1003,7 @@ int open_dev(int devnum)
char buf[20];
sprintf(buf, "%d:%d", dev2major(devnum), dev2minor(devnum));
return dev_open(buf, O_RDWR);
return dev_open(buf, O_RDONLY);
}
int open_dev_excl(int devnum)