Do not use getlogin, it's different (and/or broken) on AIX

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@492 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-05-05 04:38:02 +00:00
parent aea2aad5e8
commit a28eb78a9d

View File

@@ -176,14 +176,11 @@ login(char *host)
return (0); return (0);
} }
while (user == NULL) { while (user == NULL) {
char *myname = getlogin(); char *myname = NULL;
if (myname == NULL) {
struct passwd *pp = getpwuid(getuid()); struct passwd *pp = getpwuid(getuid());
if (pp != NULL) if (pp != NULL)
myname = pp->pw_name; myname = pp->pw_name;
}
if (myname) if (myname)
printf("Name (%s:%s): ", host, myname); printf("Name (%s:%s): ", host, myname);
else else