summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-05-17 18:29:12 +0000
committerkientzle <kientzle@FreeBSD.org>2004-05-17 18:29:12 +0000
commit75a7f5bd6ee2c47cc39d9c2ffc368b126e44e538 (patch)
treeff27cf80d6c79bfbb9bbdbd8a266efea7d5c1c60 /usr.bin
parentd686b7f3d62f0fc8cdae311688c58ea962e5b15f (diff)
downloadFreeBSD-src-75a7f5bd6ee2c47cc39d9c2ffc368b126e44e538.zip
FreeBSD-src-75a7f5bd6ee2c47cc39d9c2ffc368b126e44e538.tar.gz
Set errno to 0 before calling getpwuid/getgrgid, so that error
messages will be displayed only when there is, in fact, an error.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tar/write.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c
index e9cfcd0..3e1de2d 100644
--- a/usr.bin/tar/write.c
+++ b/usr.bin/tar/write.c
@@ -1196,6 +1196,7 @@ lookup_uname_helper(struct bsdtar *bsdtar, const char **name, id_t id)
(void)bsdtar; /* UNUSED */
+ errno = 0;
pwent = getpwuid((uid_t)id);
if (pwent == NULL) {
*name = NULL;
@@ -1222,6 +1223,7 @@ lookup_gname_helper(struct bsdtar *bsdtar, const char **name, id_t id)
(void)bsdtar; /* UNUSED */
+ errno = 0;
grent = getgrgid((gid_t)id);
if (grent == NULL && errno != 0) {
*name = NULL;
OpenPOWER on IntegriCloud