There could be stale entries in blkid file, so if the device does not
exist, skip it.
Addresses-Debian-Bug: #487758, #487783
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* %End-Header%
*/
+#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
bit_names);
if (!strcmp(tmp->bit_val, value) &&
- tmp->bit_dev->bid_pri > pri) {
+ (tmp->bit_dev->bid_pri > pri) &&
+ !access(tmp->bit_dev->bid_name, F_OK)) {
dev = tmp->bit_dev;
pri = dev->bid_pri;
}
}
if (dev && !(dev->bid_flags & BLKID_BID_FL_VERIFIED)) {
dev = blkid_verify(cache, dev);
- if (dev && (dev->bid_flags & BLKID_BID_FL_VERIFIED))
+ if (!dev || (dev && (dev->bid_flags & BLKID_BID_FL_VERIFIED)))
goto try_again;
}