summaryrefslogtreecommitdiff
path: root/ufs-fsck
diff options
context:
space:
mode:
Diffstat (limited to 'ufs-fsck')
-rw-r--r--ufs-fsck/utilities.c25
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]);
+}
+