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

src/copy.c

index 4e8b23c50571bea3db6d6062b01b03607a34a412..eb95f29d7789d22455022888fc3d623f22a7c23b 100644 (file)
@@ -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;