MCPcopy Create free account
hub / github.com/coreutils/coreutils / du_files

Function du_files

src/du.c:724–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722 Return true if successful. */
723
724static bool
725du_files (char **files, int bit_flags)
726{
727 bool ok = true;
728
729 if (*files)
730 {
731 FTS *fts = xfts_open (files, bit_flags, NULL);
732
733 while (true)
734 {
735 FTSENT *ent;
736
737 ent = fts_read (fts);
738 if (ent == NULL)
739 {
740 if (errno != 0)
741 {
742 error (0, errno, _("fts_read failed: %s"),
743 quotef (fts->fts_path));
744 ok = false;
745 }
746
747 /* When exiting this loop early, be careful to reset the
748 global, prev_level, used in process_file. Otherwise, its
749 (level == prev_level - 1) assertion could fail. */
750 prev_level = 0;
751 break;
752 }
753
754#if GNULIB_FTS_DEBUG
755 if (fts_debug)
756 fts_cross_check (fts);
757#endif
758
759 ok &= process_file (fts, ent);
760 }
761
762 if (fts_close (fts) != 0)
763 {
764 error (0, errno, _("fts_close failed"));
765 ok = false;
766 }
767 }
768
769 return ok;
770}
771
772int
773main (int argc, char **argv)

Callers 1

mainFunction · 0.85

Calls 2

xfts_openFunction · 0.85
process_fileFunction · 0.70

Tested by

no test coverage detected