diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-05-17 18:29:12 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-05-17 18:29:12 +0000 |
commit | 75a7f5bd6ee2c47cc39d9c2ffc368b126e44e538 (patch) | |
tree | ff27cf80d6c79bfbb9bbdbd8a266efea7d5c1c60 /usr.bin | |
parent | d686b7f3d62f0fc8cdae311688c58ea962e5b15f (diff) | |
download | FreeBSD-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.c | 2 |
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; |