Skip to content

Commit 0ab9b8d

Browse files
committed
Add error check
1 parent 794ef96 commit 0ab9b8d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/php/libsdk/SDK/Lock.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ protected function doLock(int $flags = LOCK_EX) : bool
6666
} else {
6767
$this->fd = fopen($this->fn, "wb");
6868
}
69+
if (false === $this->fd) {
70+
throw new Exception("Failed to open lock under '$this->fn'");
71+
}
6972
$this->locked = flock($this->fd, $flags, $this->wouldBlock);
7073
return $this->locked;
7174
}/*}}}*/

0 commit comments

Comments
 (0)