File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fn main() {
3333 // Display PID of process holding the lock
3434 // PID will be stored in a lock file
3535 let lock_path = config. out . join ( "lock" ) ;
36- let pid = fs:: read_to_string ( & lock_path) . unwrap_or_default ( ) ;
36+ let pid = fs:: read_to_string ( & lock_path) ;
3737
3838 build_lock = fd_lock:: RwLock :: new ( t ! ( fs:: OpenOptions :: new( )
3939 . write( true )
@@ -47,7 +47,11 @@ fn main() {
4747 }
4848 err => {
4949 drop ( err) ;
50- println ! ( "WARNING: build directory locked by process {pid}, waiting for lock" ) ;
50+ if let Ok ( pid) = pid {
51+ println ! ( "WARNING: build directory locked by process {pid}, waiting for lock" ) ;
52+ } else {
53+ println ! ( "WARNING: build directory locked, waiting for lock" ) ;
54+ }
5155 let mut lock = t ! ( build_lock. write( ) ) ;
5256 t ! ( lock. write( process:: id( ) . to_string( ) . as_ref( ) ) ) ;
5357 lock
You can’t perform that action at this time.
0 commit comments