diff options
author | Jim Meyering <jim@meyering.net> | 2000-06-27 13:10:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-06-27 13:10:24 +0000 |
commit | 7aa50cfb3cfc34382018b167fe3623490fbb064c (patch) | |
tree | e55b64607d8fa05e1bf11ada37d7ca0a69b2d829 | |
parent | db0cd2f7e60ce6fa3f7796f20c70cda3aaa35d6c (diff) | |
download | coreutils-7aa50cfb3cfc34382018b167fe3623490fbb064c.tar.xz |
(change_dir_owner): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
-rw-r--r-- | src/chown.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/chown.c b/src/chown.c index 07337f236..5998fdf4c 100644 --- a/src/chown.c +++ b/src/chown.c @@ -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 '/'. */ |