summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-06-27 13:09:57 +0000
committerJim Meyering <jim@meyering.net>2000-06-27 13:09:57 +0000
commitdb0cd2f7e60ce6fa3f7796f20c70cda3aaa35d6c (patch)
tree83c494468114911acac6035df074b61aeede8c66 /src
parent3dc875d9bdb8fbbd3d780d554d1a5f3737016d81 (diff)
downloadcoreutils-db0cd2f7e60ce6fa3f7796f20c70cda3aaa35d6c.tar.xz
(change_dir_group): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
Diffstat (limited to 'src')
-rw-r--r--src/chgrp.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/chgrp.c b/src/chgrp.c
index ed629fec3..be9c31695 100644
--- a/src/chgrp.c
+++ b/src/chgrp.c
@@ -288,18 +288,12 @@ change_dir_group (const char *dir, gid_t group, const struct stat *statp)
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 '/'. */