mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-08 18:40:55 +03:00
0032234: Configuration, OSD_Process::UserName() - avoid using getpwuid() unimplemented by Emscripten SDK
This commit is contained in:
parent
285b5189cd
commit
6c2cf030e2
@ -99,8 +99,13 @@ Standard_Integer OSD_Process::ProcessId(){
|
|||||||
|
|
||||||
TCollection_AsciiString OSD_Process::UserName()
|
TCollection_AsciiString OSD_Process::UserName()
|
||||||
{
|
{
|
||||||
|
#if defined(__EMSCRIPTEN__)
|
||||||
|
// Emscripten SDK raises TODO exception in runtime while calling getpwuid()
|
||||||
|
return TCollection_AsciiString();
|
||||||
|
#else
|
||||||
struct passwd *anInfos = getpwuid (getuid());
|
struct passwd *anInfos = getpwuid (getuid());
|
||||||
return TCollection_AsciiString (anInfos ? anInfos->pw_name : "");
|
return TCollection_AsciiString (anInfos ? anInfos->pw_name : "");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean OSD_Process::IsSuperUser (){
|
Standard_Boolean OSD_Process::IsSuperUser (){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user