1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Ignore sysfs symlinks when DT_UNKNOWN.

This commit is contained in:
Alasdair Kergon 2004-12-21 18:29:46 +00:00
parent 57b083718d
commit f6ab00eb54
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.00.32 -
====================================
Ignore sysfs symlinks when DT_UNKNOWN.
Add clvmd init script for RHEL4.
Skip devices that are too small to be PVs.
Fix pvchange -x segfault with lvm2-format orphan.

View File

@ -194,8 +194,10 @@ static int _read_devs(struct dev_set *ds, const char *dir)
dtype = d->d_type;
if (dtype == DT_UNKNOWN) {
if (stat(path, &info) >= 0) {
if (S_ISDIR(info.st_mode))
if (lstat(path, &info) >= 0) {
if (S_ISLNK(info.st_mode))
dtype = DT_LNK;
else if (S_ISDIR(info.st_mode))
dtype = DT_DIR;
else if (S_ISREG(info.st_mode))
dtype = DT_REG;