"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
tweak gotd getpwnam err message
To:
gameoftrees@openbsd.org
Date:
Thu, 29 Dec 2022 10:24:12 +0100

Download raw body.

Thread
first, use fatalx instead of fatal.  The ERRORS section of getpwnam(3)
doesn't give the idea errno is set to something useful.

Second, there's a typo (it's getpwnam(3), not getpwuid(3)) but while
here i've simplified the message.

ok?

diff /home/op/w/got
commit - 9bd4acdbfe311b4b5045d0166f795ddbb5c27cbc
path + /home/op/w/got
blob - 97731f1e9b245bfea3cec151f3d56b6c81205390
file + gotd/gotd.c
--- gotd/gotd.c
+++ gotd/gotd.c
@@ -2160,7 +2160,7 @@ main(int argc, char **argv)
 
 	pw = getpwnam(gotd.user_name);
 	if (pw == NULL)
-		fatal("getpwuid: user %s not found", gotd.user_name);
+		fatalx("user %s not found", gotd.user_name);
 
 	if (pw->pw_uid == 0) {
 		fatalx("cannot run %s as %s: the user running %s "