From 6c2cf030e2f8f17d5ad41c6f33b107f4f673cd81 Mon Sep 17 00:00:00 2001 From: kgv Date: Sun, 21 Mar 2021 23:26:56 +0300 Subject: [PATCH] 0032234: Configuration, OSD_Process::UserName() - avoid using getpwuid() unimplemented by Emscripten SDK --- src/OSD/OSD_Process.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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 (){