mirror of https://github.com/FreeRDP/FreeRDP
Fixed fallback to getlogin for android
This commit is contained in:
parent
308c2c3544
commit
caff01877d
|
@ -600,8 +600,12 @@ static BOOL isAutomountLocation(const char* path)
|
|||
uid_t uid = getuid();
|
||||
char uname[MAX_PATH] = { 0 };
|
||||
|
||||
#ifndef getlogin_r
|
||||
strncpy(uname, getlogin(), sizeof(uname));
|
||||
#else
|
||||
if (getlogin_r(uname, sizeof(uname)) != 0)
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
if (!path)
|
||||
return FALSE;
|
||||
|
|
|
@ -206,8 +206,12 @@ BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG
|
|||
switch (NameFormat)
|
||||
{
|
||||
case NameSamCompatible:
|
||||
#ifndef getlogin_r
|
||||
strncpy(login, getlogin(), sizeof(login));
|
||||
#else
|
||||
if (getlogin_r(login, sizeof(login)) != 0)
|
||||
return FALSE;
|
||||
#endif
|
||||
length = strlen(login);
|
||||
|
||||
if (*nSize >= length)
|
||||
|
|
Loading…
Reference in New Issue