summaryrefslogtreecommitdiff
path: root/lib/libc_r/TEST/test_pw.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/TEST/test_pw.c')
-rw-r--r--lib/libc_r/TEST/test_pw.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/libc_r/TEST/test_pw.c b/lib/libc_r/TEST/test_pw.c
index d7740a109eb..b99e7cc37fd 100644
--- a/lib/libc_r/TEST/test_pw.c
+++ b/lib/libc_r/TEST/test_pw.c
@@ -2,20 +2,18 @@
#include <sys/types.h>
#include <unistd.h>
#include <pwd.h>
+#include "test.h"
int
main()
{
- struct passwd *pw;
+ struct passwd *pw;
- pw = getpwuid(getuid());
- if (!pw) {
- printf("getpwuid(%d) died!\n", getuid());
- exit(1);
- }
- printf("getpwuid(%d) => %p\n", getuid(), pw);
- printf(" you are: %s\n uid: %d\n gid: %d\n class: %s\n gecos: %s\n dir: %s\n shell: %s\n",
- pw->pw_name, pw->pw_uid, pw->pw_gid, pw->pw_class, pw->pw_gecos, pw->pw_dir,
- pw->pw_shell);
- exit(0);
+ CHECKen(pw = getpwuid(getuid()));
+ printf("getpwuid(%d) => %p\n", getuid(), pw);
+ printf(" name: %s\n uid: %d\n gid: %d\n"
+ "class: %s\ngecos: %s\n dir: %s\nshell: %s\n",
+ pw->pw_name, pw->pw_uid, pw->pw_gid,
+ pw->pw_class, pw->pw_gecos, pw->pw_dir, pw->pw_shell);
+ SUCCEED;
}