summaryrefslogtreecommitdiff
path: root/src/chmod.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-06-27 13:10:50 +0000
committerJim Meyering <jim@meyering.net>2000-06-27 13:10:50 +0000
commit53ec884edb17c5d95c9247731d061bc710955203 (patch)
tree30ed4bf448065dbeb6623171195ce655ed989e69 /src/chmod.c
parent7aa50cfb3cfc34382018b167fe3623490fbb064c (diff)
downloadcoreutils-53ec884edb17c5d95c9247731d061bc710955203.tar.xz
(change_dir_mode): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
Diffstat (limited to 'src/chmod.c')
-rw-r--r--src/chmod.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/chmod.c b/src/chmod.c
index 5d6a9b163..41c538873 100644
--- a/src/chmod.c
+++ b/src/chmod.c
@@ -197,18 +197,12 @@ change_dir_mode (const char *dir, const struct mode_change *changes,
unsigned pathlength; /* Bytes allocated for `path'. */
int errors = 0;
- errno = 0;
name_space = savedir (dir, statp->st_size);
if (name_space == NULL)
{
- if (errno)
- {
- if (force_silent == 0)
- error (0, errno, "%s", dir);
- return 1;
- }
- else
- error (1, 0, _("virtual memory exhausted"));
+ if (force_silent == 0)
+ error (0, errno, "%s", dir);
+ return 1;
}
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */