Avoid using lstat, it isn't right.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
This commit is contained in:
parent
98ce384920
commit
0bbc98b563
|
@ -1,3 +1,6 @@
|
||||||
|
Changes Prior to this release
|
||||||
|
- Don't use 'lstat' to check for blockdevices, use stat.
|
||||||
|
|
||||||
Changes Prior to 1.11.0 release
|
Changes Prior to 1.11.0 release
|
||||||
- Fix embarassing bug which causes --add to always fail.
|
- Fix embarassing bug which causes --add to always fail.
|
||||||
|
|
||||||
|
|
2
mdopen.c
2
mdopen.c
|
@ -97,7 +97,7 @@ int open_mddev(char *dev, int autof)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
stb.st_mode = 0;
|
stb.st_mode = 0;
|
||||||
if (lstat(dev, &stb)==0 && ! S_ISBLK(stb.st_mode)) {
|
if (stat(dev, &stb)==0 && ! S_ISBLK(stb.st_mode)) {
|
||||||
fprintf(stderr, Name ": %s is not a block device.\n",
|
fprintf(stderr, Name ": %s is not a block device.\n",
|
||||||
dev);
|
dev);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue