diff options
| author | Michael I. Bushnell <mib@gnu.org> | 1994-10-14 21:23:31 +0000 |
|---|---|---|
| committer | Michael I. Bushnell <mib@gnu.org> | 1994-10-14 21:23:31 +0000 |
| commit | 32240511feea3e5d7fcda255788128c8010af6d8 (patch) | |
| tree | 1a63cb1240db8ee4e0105b4fc160917ac97c5a9a | |
| parent | 35372ce18ca8e12a5b8a74e2f8a752197946965f (diff) | |
Formerly utilities.c.~5~
| -rw-r--r-- | ufs-fsck/utilities.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/ufs-fsck/utilities.c b/ufs-fsck/utilities.c index 7dacaa95..4780ac8a 100644 --- a/ufs-fsck/utilities.c +++ b/ufs-fsck/utilities.c @@ -23,6 +23,7 @@ #include <sys/file.h> #include <unistd.h> #include <stdarg.h> +#include <pwd.h> /* Read disk block ADDR into BUF of SIZE bytes. */ void @@ -229,6 +230,28 @@ reply (char *question) } } +/* Print a helpful description of the given inode number. */ +void +pinode (ino_t ino) +{ + struct dinode dino; + struct passwd *pw; + char *p; + + printf (" I=%d ", ino); + if (ino < ROOTINO || ino > maxino) + return; + getinode (ino, &dino); + printf (" OWNER="); + if (pw = getpwuid (dino.di_uid)) + printf ("%s ", pw->pw_name); + else + printf ("%lu ", dino.di_uid); - + printf (" MODE=%o\n", DI_MODE (&dino)); + printf ("SIZE=%llu ", dino.di_size); + p = ctime (&dino.di_mtime.ts_sec); + printf ("MTIME=%12.12s %4.4s ", &p[4], &p[20]); +} + |
