]> OCCT Git - occt.git/commitdiff
0032234: Configuration, OSD_Process::UserName() - avoid using getpwuid() unimplemente...
authorkgv <kgv@opencascade.com>
Sun, 21 Mar 2021 20:26:56 +0000 (23:26 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sat, 27 Mar 2021 10:46:03 +0000 (13:46 +0300)
src/OSD/OSD_Process.cxx

index d7f4b7923e39a16d8adad41254931c73dbc95ae9..bb530e9b151da25d793eaaee6c4ed6432302138f 100644 (file)
@@ -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 (){