[BACK]Return to du.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / du

Diff for /src/usr.bin/du/du.c between version 1.31 and 1.32

version 1.31, 2015/10/10 05:32:52 version 1.32, 2016/08/24 03:13:45
Line 50 
Line 50 
   
   
 int      linkchk(FTSENT *);  int      linkchk(FTSENT *);
 void     prtout(quad_t, char *, int);  void     prtout(int64_t, char *, int);
 void     usage(void);  void     usage(void);
   
 int  int
Line 59 
Line 59 
         FTS *fts;          FTS *fts;
         FTSENT *p;          FTSENT *p;
         long blocksize;          long blocksize;
         quad_t totalblocks;          int64_t totalblocks;
         int ftsoptions, listfiles, maxdepth;          int ftsoptions, listfiles, maxdepth;
         int Hflag, Lflag, cflag, hflag, kflag;          int Hflag, Lflag, cflag, hflag, kflag;
         int ch, notused, rval;          int ch, notused, rval;
Line 177 
Line 177 
                          * root of a traversal, display the total.                           * root of a traversal, display the total.
                          */                           */
                         if (p->fts_level <= maxdepth)                          if (p->fts_level <= maxdepth)
                                 prtout((quad_t)howmany(p->fts_number,                                  prtout(howmany(p->fts_number,
                                     (unsigned long)blocksize), p->fts_path,                                      (unsigned long)blocksize), p->fts_path,
                                     hflag);                                      hflag);
                         break;                          break;
Line 207 
Line 207 
         if (errno)          if (errno)
                 err(1, "fts_read");                  err(1, "fts_read");
         if (cflag) {          if (cflag) {
                 prtout((quad_t)howmany(totalblocks, blocksize), "total", hflag);                  prtout(howmany(totalblocks, blocksize), "total", hflag);
         }          }
         fts_close(fts);          fts_close(fts);
         exit(rval);          exit(rval);
Line 301 
Line 301 
 }  }
   
 void  void
 prtout(quad_t size, char *path, int hflag)  prtout(int64_t size, char *path, int hflag)
 {  {
         if (!hflag)          if (!hflag)
                 (void)printf("%lld\t%s\n", (long long)size, path);                  (void)printf("%lld\t%s\n", size, path);
         else {          else {
                 char buf[FMT_SCALED_STRSIZE];                  char buf[FMT_SCALED_STRSIZE];
   
                 if (fmt_scaled(size * 512, buf) == 0)                  if (fmt_scaled(size * 512, buf) == 0)
                         (void)printf("%s\t%s\n", buf, path);                          (void)printf("%s\t%s\n", buf, path);
                 else                  else
                         (void)printf("%lld\t%s\n", (long long)size, path);                          (void)printf("%lld\t%s\n", size, path);
         }          }
 }  }
   

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32