Don't immediatly fail if block device cannot be stat'ed.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
int len = strlen(block);
char *point = NULL, *pos, *tmp, *cpoint, *devname;
struct stat s;
+ int rstat;
unsigned int minor, major;
if (!fp)
return NULL;
- if (stat(block, &s))
- return NULL;
+ rstat = stat(block, &s);
while (fgets(line, sizeof(line), fp)) {
pos = strchr(line, ' ');
break;
}
+ if (rstat)
+ continue;
+
if (!S_ISBLK(s.st_mode))
continue;