Also check against chardevs when looking for root.

This commit is contained in:
Poul-Henning Kamp 1999-07-20 08:50:54 +00:00
parent 9df36b4d0d
commit bb7c1ea0a0
4 changed files with 12 additions and 4 deletions

View File

@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$Id: preen.c,v 1.9 1998/06/15 07:07:20 charnier Exp $";
"$Id: preen.c,v 1.11 1998/12/03 02:41:11 julian Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -320,6 +320,8 @@ blockcheck(origname)
return (origname);
}
if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
if (stslash.st_dev == stchar.st_rdev)
hotroot++;
return (raw);
} else {
printf("%s is not a character device\n", raw);

View File

@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$Id: preen.c,v 1.9 1998/06/15 07:07:20 charnier Exp $";
"$Id: preen.c,v 1.11 1998/12/03 02:41:11 julian Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -320,6 +320,8 @@ blockcheck(origname)
return (origname);
}
if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
if (stslash.st_dev == stchar.st_rdev)
hotroot++;
return (raw);
} else {
printf("%s is not a character device\n", raw);

View File

@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$Id: preen.c,v 1.9 1998/06/15 07:07:20 charnier Exp $";
"$Id: preen.c,v 1.11 1998/12/03 02:41:11 julian Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -320,6 +320,8 @@ blockcheck(origname)
return (origname);
}
if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
if (stslash.st_dev == stchar.st_rdev)
hotroot++;
return (raw);
} else {
printf("%s is not a character device\n", raw);

View File

@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)preen.c 8.5 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$Id: preen.c,v 1.9 1998/06/15 07:07:20 charnier Exp $";
"$Id: preen.c,v 1.11 1998/12/03 02:41:11 julian Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -320,6 +320,8 @@ blockcheck(origname)
return (origname);
}
if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
if (stslash.st_dev == stchar.st_rdev)
hotroot++;
return (raw);
} else {
printf("%s is not a character device\n", raw);