summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-06-27 13:11:36 +0000
committerJim Meyering <jim@meyering.net>2000-06-27 13:11:36 +0000
commit7e2d22e2a6ae138cf9ae3ff5a9a31e04b5693a08 (patch)
tree57d652125ba8dc8f5a065af8948e2a1399111830 /src
parente068bafb72758fab1eb181c9880537214280e93c (diff)
downloadcoreutils-7e2d22e2a6ae138cf9ae3ff5a9a31e04b5693a08.tar.xz
(copy_dir): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/copy.c b/src/copy.c
index 4e8b23c50..eb95f29d7 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -114,17 +114,11 @@ copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
char *namep;
int ret = 0;
- errno = 0;
name_space = savedir (src_path_in, src_sb->st_size);
- if (name_space == 0)
+ if (name_space == NULL)
{
- if (errno)
- {
- error (0, errno, "%s", src_path_in);
- return -1;
- }
- else
- error (1, 0, _("virtual memory exhausted"));
+ error (0, errno, "%s", src_path_in);
+ return -1;
}
namep = name_space;