@@ -238,6 +238,8 @@ async fn main() {
238238
239239#[ cfg( target_os = "linux" ) ]
240240async fn allow_multiple_running_check ( current_pid : sysinfo:: Pid , kill_old : bool , page : Option < String > ) {
241+ use std:: ffi:: OsString ;
242+
241243 use tracing:: debug;
242244
243245 if kill_old {
@@ -249,7 +251,8 @@ async fn allow_multiple_running_check(current_pid: sysinfo::Pid, kill_old: bool,
249251 let system = System :: new_with_specifics (
250252 RefreshKind :: new ( ) . with_processes ( ProcessRefreshKind :: new ( ) . with_user ( sysinfo:: UpdateKind :: Always ) ) ,
251253 ) ;
252- let processes = system. processes_by_exact_name ( APP_PROCESS_NAME ) ;
254+ let app_process_name = OsString :: from ( APP_PROCESS_NAME ) ;
255+ let processes = system. processes_by_exact_name ( & app_process_name) ;
253256
254257 let processes = processes. collect :: < Vec < _ > > ( ) ;
255258 debug ! ( "Checking for already running desktop instance: {:?}" , processes) ;
@@ -293,8 +296,11 @@ async fn allow_multiple_running_check(current_pid: sysinfo::Pid, kill_old: bool,
293296
294297#[ cfg( target_os = "macos" ) ]
295298async fn allow_multiple_running_check ( current_pid : sysinfo:: Pid , kill_old : bool , page : Option < String > ) {
299+ use std:: ffi:: OsString ;
300+
301+ let app_process_name = OsString :: from ( APP_PROCESS_NAME ) ;
296302 let system = System :: new_with_specifics ( RefreshKind :: new ( ) . with_processes ( ProcessRefreshKind :: new ( ) ) ) ;
297- let processes = system. processes_by_name ( APP_PROCESS_NAME ) ;
303+ let processes = system. processes_by_name ( & app_process_name ) ;
298304
299305 cfg_if:: cfg_if! {
300306 if #[ cfg( unix) ] {
0 commit comments