summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-10-14 21:23:31 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-10-14 21:23:31 +0000
commit59a6501b5fefd27ec32efd355060dbc8c745bf9a (patch)
tree25db7c1b2beb4ee5bfa2a9bb46d25b4e38867fe2
parent35edb676940ff1900cf3bc5f9c168e2d7a21d686 (diff)
Formerly utilities.c.~5~
-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]);
+}
+