Whamcloud - gitweb
In debugfs, make "ls -l" print out the file type information in the
authorTheodore Ts'o <tytso@mit.edu>
Tue, 26 Feb 2002 22:13:12 +0000 (17:13 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 26 Feb 2002 22:13:12 +0000 (17:13 -0500)
directory entry.

debugfs/ChangeLog
debugfs/ls.c

index 2a0e482..f3a5a67 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-26  Theodore Tso  <tytso@mit.edu>
+
+       * ls.c (list_dir_proc): When listing the directory entry in long 
+               format, include the file type of the directory entry in 
+               parenthesis.
+
 2002-02-25  Theodore Tso  <tytso@mit.edu>
 
        * util.c (open_pager): If the PAGER environment is set to __none__
index 2fb91f5..96d2691 100644 (file)
@@ -51,6 +51,7 @@ static int list_dir_proc(ext2_ino_t dir,
                         char   *buf,
                         void   *private)
 {
+       struct ext2_dir_entry_2 *d2;
        struct ext2_inode       inode;
        ext2_ino_t              ino;
        struct tm               *tm_p;
@@ -89,8 +90,9 @@ static int list_dir_proc(ext2_ino_t dir,
                        strcpy(datestr, "                 ");
                        memset(&inode, 0, sizeof(struct ext2_inode));
                }
-               fprintf(ls->f, "%c%6u%c %6o  %5d  %5d   ", lbr, ino, rbr,
-                       inode.i_mode, inode.i_uid, inode.i_gid);
+               d2 = (struct dir_entry_2 *) dirent;
+               fprintf(ls->f, "%c%6u%c %6o (%d)  %5d  %5d   ", lbr, ino, rbr,
+                       inode.i_mode, d2->file_type, inode.i_uid, inode.i_gid);
                if (LINUX_S_ISDIR(inode.i_mode))
                        fprintf(ls->f, "%5d", inode.i_size);
                else