summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-07-30 15:18:31 -0400
committerjim-p <jimp@pfsense.org>2012-07-30 15:18:31 -0400
commit780705e9b8058130fa6b9e15dcca46f85df23395 (patch)
tree9750b1378de86d58e37709ee5843155a691e440a /etc/inc/util.inc
parenta9f250d6a3372404cb7adb9c6d870eb085f566d0 (diff)
downloadpfsense-780705e9b8058130fa6b9e15dcca46f85df23395.zip
pfsense-780705e9b8058130fa6b9e15dcca46f85df23395.tar.gz
Fix negative test
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 565b8b7..b720d29 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -215,12 +215,12 @@ function refcount_unreference($reference) {
/* We assume that the shared memory exists. */
$shmid = @shmop_open($reference, "w", 0, 0);
$shm_data = @shmop_read($shmid, 0, 10);
- $shm_data = str_pad(intval($shm_data) - 1, 4, "0", STR_PAD_LEFT);
+ $shm_data = intval($shm_data) - 1;
if ($shm_data < 0) {
//debug_backtrace();
log_error(sprintf(gettext("Reference %s is going negative, not doing unreference."), $reference));
} else
- @shmop_write($shmid, $shm_data, 0);
+ @shmop_write($shmid, str_pad($shm_data, 4, "0", STR_PAD_LEFT), 0);
@shmop_close($shmid);
} catch (Exception $e) {
log_error($e->getMessage());
OpenPOWER on IntegriCloud