]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
merge with 3.5.2
authorJim Meyering <jim@meyering.net>
Thu, 6 May 1993 05:34:26 +0000 (05:34 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 6 May 1993 05:34:26 +0000 (05:34 +0000)
src/du.c

index 3d845e90c43a53364c31998f2afdccc710c7ade7..a18ed4451ab71d6a91ecbf507313cc5267bf78b8 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -415,7 +415,9 @@ count_entry (ent, top, last_dev)
          if (errno)
            {
              error (0, errno, "%s", path->text);
-             chdir ("..");     /* Try to return to previous directory.  */
+             if (chdir ("..") < 0)     /* Try to return to previous dir.  */
+               error (1, errno, "cannot change to `..' from directory %s",
+                      path->text);
              exit_status = 1;
              return 0;
            }
@@ -439,7 +441,8 @@ count_entry (ent, top, last_dev)
          namep += strlen (namep) + 1;
        }
       free (name_space);
-      chdir ("..");
+      if (chdir ("..") < 0)
+        error (1, errno, "cannot change to `..' from directory %s", path->text);
 
       str_trunc (path, pathlen - 1); /* Remove the "/" we added.  */
       if (!opt_summarize_only || top)