]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(count_entry): Don't set errno before
authorJim Meyering <jim@meyering.net>
Tue, 27 Jun 2000 13:12:12 +0000 (13:12 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 27 Jun 2000 13:12:12 +0000 (13:12 +0000)
invoking savedir, and assume that errno is nonzero if savedir fails.

src/du.c

index 9bfe56a912093aae734c039089f54df5681e446e..38f25ed26f57363021d7e78b6a57d4c8eb51735b 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -550,19 +550,13 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
          return 0;
        }
 
-      errno = 0;
       name_space = savedir (".", stat_buf.st_size);
       if (name_space == NULL)
        {
-         if (errno)
-           {
-             error (0, errno, "%s", path->text);
-             pop_dir (cwd, path->text);
-             exit_status = 1;
-             return 0;
-           }
-         else
-           error (1, 0, _("virtual memory exhausted"));
+         error (0, errno, "%s", path->text);
+         pop_dir (cwd, path->text);
+         exit_status = 1;
+         return 0;
        }
 
       /* Remember the current path.  */