File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fn main() {
33
33
// Display PID of process holding the lock
34
34
// PID will be stored in a lock file
35
35
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) ;
37
37
38
38
build_lock = fd_lock:: RwLock :: new ( t ! ( fs:: OpenOptions :: new( )
39
39
. write( true )
@@ -47,7 +47,11 @@ fn main() {
47
47
}
48
48
err => {
49
49
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
+ }
51
55
let mut lock = t ! ( build_lock. write( ) ) ;
52
56
t ! ( lock. write( process:: id( ) . to_string( ) . as_ref( ) ) ) ;
53
57
lock
You can’t perform that action at this time.
0 commit comments