diff options
author | Jim Meyering <jim@meyering.net> | 1993-05-06 05:34:26 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1993-05-06 05:34:26 +0000 |
commit | f7999d7584ad787f4e7432b7ad76cc3486bc7b0b (patch) | |
tree | e1769261c6b1ac82b9ecaed02712499d93e653f3 | |
parent | 236ab993af66a347349200119b15ff6ab62bb20d (diff) | |
download | coreutils-f7999d7584ad787f4e7432b7ad76cc3486bc7b0b.tar.xz |
merge with 3.5.2
-rw-r--r-- | src/du.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |