summaryrefslogtreecommitdiff
path: root/src/du.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-06-27 13:12:12 +0000
committerJim Meyering <jim@meyering.net>2000-06-27 13:12:12 +0000
commitb1b5fb67fcde78dc6badf685e28d1e6ad98f208a (patch)
tree32430b32d1c5c365c95cc3408d36c26384761768 /src/du.c
parent7e2d22e2a6ae138cf9ae3ff5a9a31e04b5693a08 (diff)
downloadcoreutils-b1b5fb67fcde78dc6badf685e28d1e6ad98f208a.tar.xz
(count_entry): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
Diffstat (limited to 'src/du.c')
-rw-r--r--src/du.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/du.c b/src/du.c
index 9bfe56a91..38f25ed26 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. */