diff --git a/src/lrc.cpp b/src/lrc.cpp
index 6c9cba4898367ec3e900cc42d522a9aa54df507d..d23a57b472657a7232997bdee9e2dbc09a5ee7d6 100644
--- a/src/lrc.cpp
+++ b/src/lrc.cpp
@@ -71,8 +71,10 @@ Lrc::Lrc(MigrationCb willDoMigrationCb, MigrationCb didDoMigrationCb, bool muteD
     // Replace locale for timestamps
     std::locale::global(std::locale(""));
 #else
+#ifdef Q_OS_LINUX
     if (!getenv("JAMI_DISABLE_SHM"))
         setenv("JAMI_DISABLE_SHM", "1", true);
+#endif
 #endif
     // Ensure Daemon is running/loaded (especially on non-DBus platforms)
     // before instantiating LRC and its members