d_off is offset of *next* dirent, so no need to ++
authorKevin Klues <klueska@cs.berkeley.edu>
Tue, 8 Feb 2011 04:55:07 +0000 (20:55 -0800)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:57 +0000 (17:35 -0700)
Old way of doing it was skipping every other entry.

kern/src/monitor.c

index 8b5f629..3523032 100644 (file)
@@ -267,7 +267,6 @@ int mon_bin_ls(int argc, char *NTS *NT COUNT(argc) argv, trapframe_t *tf)
        do {
                retval = bin_dir->f_op->readdir(bin_dir, &dir); 
                printk("%s\n", dir.d_name);
-               dir.d_off++;
        } while (retval == 1);
        kref_put(&bin_dir->f_kref);
        return 0;