mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-06-07 10:16:46 +02:00
(change_dir_group): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
This commit is contained in:
+3
-9
@@ -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 '/'. */
|
||||
|
||||
Reference in New Issue
Block a user