1
0
mirror of https://git.savannah.gnu.org/git/coreutils.git synced 2026-11-03 19:12:42 +03:00

(change_dir_owner): Don't set errno before

invoking savedir, and assume that errno is nonzero if savedir fails.
This commit is contained in:
Jim Meyering
2000-06-27 13:10:24 +00:00
parent db0cd2f7e6
commit 7aa50cfb3c

View File

@@ -262,18 +262,12 @@ change_dir_owner (const char *dir, uid_t user, gid_t group,
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 '/'. */