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();
|
uid_t uid = getuid();
|
||||||
char uname[MAX_PATH] = { 0 };
|
char uname[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
|
#ifndef getlogin_r
|
||||||
|
strncpy(uname, getlogin(), sizeof(uname));
|
||||||
|
#else
|
||||||
if (getlogin_r(uname, sizeof(uname)) != 0)
|
if (getlogin_r(uname, sizeof(uname)) != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!path)
|
if (!path)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -206,8 +206,12 @@ BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG
|
||||||
switch (NameFormat)
|
switch (NameFormat)
|
||||||
{
|
{
|
||||||
case NameSamCompatible:
|
case NameSamCompatible:
|
||||||
|
#ifndef getlogin_r
|
||||||
|
strncpy(login, getlogin(), sizeof(login));
|
||||||
|
#else
|
||||||
if (getlogin_r(login, sizeof(login)) != 0)
|
if (getlogin_r(login, sizeof(login)) != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
#endif
|
||||||
length = strlen(login);
|
length = strlen(login);
|
||||||
|
|
||||||
if (*nSize >= length)
|
if (*nSize >= length)
|
||||||
|
|
Loading…
Reference in New Issue