File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,14 @@ pub fn main() -> anyhow::Result<()> {
4848
4949 log:: info!( "starting watt daemon" ) ;
5050
51- let lock_path = env:: var ( "XDG_RUNTIME_DIR" )
52- . map ( |dir| PathBuf :: from ( dir) . join ( "watt.pid" ) )
53- . unwrap_or_else ( |_| PathBuf :: from ( "/run/watt.pid" ) ) ;
54-
55- let _lock = lock:: LockFile :: acquire ( & lock_path, cli. force ) . context (
56- format ! ( "failed to acquire pid lock at {}" , lock_path. display( ) ) ,
57- ) ?;
51+ let lock_path = env:: var_os ( "XDG_RUNTIME_DIR" )
52+ . map_or_else ( || PathBuf :: from ( "/run" ) , PathBuf :: from)
53+ . join ( "watt.pid" ) ;
54+
55+ let _lock =
56+ lock:: LockFile :: acquire ( & lock_path, cli. force ) . with_context ( || {
57+ format ! ( "failed to acquire pid lock at {}" , lock_path. display( ) )
58+ } ) ?;
5859
5960 system:: run_daemon ( config)
6061}
You can’t perform that action at this time.
0 commit comments