Commit:    f512f6a7b845d61cbd7f53fecdbf193b00fd23e6
Author:    Anatol Belski <a...@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);
                }
        }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to