From: kgv Date: Sun, 21 Mar 2021 20:26:56 +0000 (+0300) Subject: 0032234: Configuration, OSD_Process::UserName() - avoid using getpwuid() unimplemente... X-Git-Tag: V7_6_0_beta~209 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=6c2cf030e2f8f17d5ad41c6f33b107f4f673cd81;p=occt.git 0032234: Configuration, OSD_Process::UserName() - avoid using getpwuid() unimplemented by Emscripten SDK --- diff --git a/src/OSD/OSD_Process.cxx b/src/OSD/OSD_Process.cxx index d7f4b7923e..bb530e9b15 100644 --- a/src/OSD/OSD_Process.cxx +++ b/src/OSD/OSD_Process.cxx @@ -99,8 +99,13 @@ Standard_Integer OSD_Process::ProcessId(){ 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()); return TCollection_AsciiString (anInfos ? anInfos->pw_name : ""); +#endif } Standard_Boolean OSD_Process::IsSuperUser (){