device ID iff the named file is a character or block special device. Otherwise
it is meaningless junk, in which case st_dev should be used. This was done
incorrectly, which could cause mount to display bogus mount info.
-Erik
if (stat("/", &rootStat) != 0)
bb_perror_msg("could not stat '/'");
else {
- if ((dev = rootStat.st_rdev)==0)
- dev=rootStat.st_dev;
+ /* This check is here in case they pass in /dev name */
+ if ((rootStat.st_mode & S_IFMT) == S_IFBLK)
+ dev = rootStat.st_rdev;
+ else
+ dev = rootStat.st_dev;
dir = opendir("/dev");
if (!dir)