From a25502627dbbdddb91522bef2e97f30c25a56549 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Mon, 17 May 2004 18:29:12 +0000 Subject: [PATCH] Set errno to 0 before calling getpwuid/getgrgid, so that error messages will be displayed only when there is, in fact, an error. --- usr.bin/tar/write.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index e9cfcd047f7..3e1de2d81e3 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;