From: Jim Meyering Date: Tue, 27 Jun 2000 13:12:12 +0000 (+0000) Subject: (count_entry): Don't set errno before X-Git-Tag: FILEUTILS-4_0w~37 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=b1b5fb67fcde78dc6badf685e28d1e6ad98f208a;p=thirdparty%2Fcoreutils.git (count_entry): Don't set errno before invoking savedir, and assume that errno is nonzero if savedir fails. --- diff --git a/src/du.c b/src/du.c index 9bfe56a912..38f25ed26f 100644 --- 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. */