@@ 82,9 82,13 @@ impl User {
Ok(BaseDirectories::new()?)
}
- /// Opens handles on `$XDG_STATE_HOME/rstdm-std{out,err}`, for capturing output from the [session
+ /// Opens handles on `$XDG_STATE_HOME/${SESSION_NAME}-std{out,err}`, for capturing output from the [session
/// process](crate::session::Desktop::exec).
- pub fn get_standard_outputs(&self, xdg: &BaseDirectories) -> Result<(File, File)> {
+ pub fn get_standard_outputs(
+ &self,
+ session_name: &str,
+ xdg: &BaseDirectories,
+ ) -> Result<(File, File)> {
let path = xdg.get_state_home();
let open = |file: &str| -> Result<File> {
@@ 103,8 107,8 @@ impl User {
Ok(file)
};
- let stdout = open("rstdm-stdout.log")?;
- let stderr = open("rstdm-stderr.log")?;
+ let stdout = open(&format!("{}-stdout.log", session_name))?;
+ let stderr = open(&format!("{}-stderr.log", session_name))?;
Ok((stdout, stderr))
}
@@ 116,7 120,7 @@ impl User {
dbus: Dbus,
) -> Result<ExitStatus> {
let (stdout, stderr) = self
- .get_standard_outputs(xdg)
+ .get_standard_outputs(&session.name, xdg)
.context("Failed to set up stdout/err")?;
// TODO: This and the Desktop type assume that `Exec` has one and only one argument.