Unmounting session done via ifdef instead of getenv 81/324081/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 12 May 2025 09:03:32 +0000 (11:03 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 12 May 2025 12:13:54 +0000 (14:13 +0200)
Change-Id: Ic1424b7b8ba782801d3924367355205a4e0183c4

src/service/src/dir_backend_fixed_size.cpp

index 82bc0dd24cb743fe24601e40721804fa43211fd3..dca72bcfdc47cc1df63b6f33ebbb587c807bd856 100644 (file)
@@ -132,13 +132,14 @@ void DirBackendFixedSize::RemoveSubsession (const fs::path& subsession_path) con
 
 void DirBackendFixedSize::SwitchSubsessionAway (const fs::path& subsession_path) const
 {
-       /* Keep session mounted during switch to reuse it if another switch happen.
-        * Addionally, it leaves subsession in same state as if sessiond would be restarted */
-       if (getenv("SESSIOND_NO_KEEP_SESSION_MOUNTS")) {
+#ifdef SESSIOND_UNMOUNT_SESSION_ON_SWITCH
                LOGI("Unmouting session image at %s", subsession_path.c_str());
                OS::do_umount(subsession_path);
-       } else
+#else
+               /* By default, keep subsession mounted for reuse in case it is switched to again.
+                * Addionally, this leaves subsession in the same state across sessiond restarts. */
                LOGI("Switching away from subsession but keeping image mounted at %s", subsession_path.c_str());
+#endif
 }
 
 void DirBackendFixedSize::SwitchSubsessionInto (const fs::path& subsession_path) const