com web/rmtools: Add error check: include/BuildVC.php
| From: | Anatol Belski | Date: | Tue, 05 Feb 2019 04:03:10 +0000 |
| Subject: | com web/rmtools: Add error check: include/BuildVC.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-27756@lists.php.net to get a copy of this message | ||
Commit: f512f6a7b845d61cbd7f53fecdbf193b00fd23e6
Author: Anatol Belski <ab@php.net> Mon, 4 Feb 2019 20:03:10 -0800
Parents: 3f5885385ab3faed34752bb78c7036cb7ffeff44
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=f512f6a7b845d61cbd7f53fecdbf193b00fd23e6
Log:
Add error check
Changed paths:
M include/BuildVC.php
Diff:
diff --git a/include/BuildVC.php b/include/BuildVC.php
index c68a781..6e46290 100644
--- a/include/BuildVC.php
+++ b/include/BuildVC.php
@@ -129,7 +129,11 @@ class BuildVC {
function pgoInitLock()
{
if (is_null($this->pgo_init_lock_fd)) {
- $this->pgo_init_lock_fd = fopen(TMP_DIR . DIRECTORY_SEPARATOR .
"sdk_pgo_init.lock", "wb");
+ $fn = TMP_DIR . DIRECTORY_SEPARATOR . "sdk_pgo_init.lock";
+ $this->pgo_init_lock_fd = fopen($fn, "wb");
+ if (false == $this->pgo_init_lock_fd) {
+ throw new \Exception("Failed to create lock under '$fn'");
+ }
flock($this->pgo_init_lock_fd, LOCK_EX);
}
}