From: Jim Meyering Date: Tue, 27 Jun 2000 13:09:57 +0000 (+0000) Subject: (change_dir_group): Don't set errno before X-Git-Tag: FILEUTILS-4_0w~42 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=db0cd2f7e60ce6fa3f7796f20c70cda3aaa35d6c;p=thirdparty%2Fcoreutils.git (change_dir_group): Don't set errno before invoking savedir, and assume that errno is nonzero if savedir fails. --- diff --git a/src/chgrp.c b/src/chgrp.c index ed629fec3d..be9c31695f 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 '/'. */