diff options
author | Dmitry Stogov <dmitry@zend.com> | 2016-06-21 16:00:37 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2016-06-21 16:00:37 +0300 |
commit | 16160386982a86e6ec7969c6c89707d38228f19e (patch) | |
tree | 47052539a23ab7d6d2cf79392dd1e47de67bb2f1 /ext/sysvsem | |
parent | 67e23f4be3c01a389043ee97b98d6bcc703d3557 (diff) | |
download | php-git-16160386982a86e6ec7969c6c89707d38228f19e.tar.gz |
Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
Diffstat (limited to 'ext/sysvsem')
-rw-r--r-- | ext/sysvsem/sysvsem.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index e28e6b4c1b..923f7c3853 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -206,7 +206,7 @@ PHP_FUNCTION(sem_get) semid = semget(key, 3, perm|IPC_CREAT); if (semid == -1) { - php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); + php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno)); RETURN_FALSE; } @@ -238,7 +238,7 @@ PHP_FUNCTION(sem_get) sop[2].sem_flg = SEM_UNDO; while (semop(semid, sop, 3) == -1) { if (errno != EINTR) { - php_error_docref(NULL, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno)); + php_error_docref(NULL, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno)); break; } } @@ -246,7 +246,7 @@ PHP_FUNCTION(sem_get) /* Get the usage count. */ count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL); if (count == -1) { - php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); + php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno)); } /* If we are the only user, then take this opportunity to set the max. */ @@ -257,7 +257,7 @@ PHP_FUNCTION(sem_get) union semun semarg; semarg.val = max_acquire; if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) { - php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); + php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno)); } #elif defined(SETVAL_WANTS_PTR) /* This is correct for Solaris 2.6 which does not have union semun. */ @@ -279,7 +279,7 @@ PHP_FUNCTION(sem_get) sop[0].sem_flg = SEM_UNDO; while (semop(semid, sop, 1) == -1) { if (errno != EINTR) { - php_error_docref(NULL, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno)); + php_error_docref(NULL, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno)); break; } } @@ -319,7 +319,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire) } if (!acquire && sem_ptr->count == 0) { - php_error_docref(NULL, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key); + php_error_docref(NULL, E_WARNING, "SysV semaphore " ZEND_LONG_FMT " (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key); RETURN_FALSE; } @@ -388,7 +388,7 @@ PHP_FUNCTION(sem_remove) #else if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) { #endif - php_error_docref(NULL, E_WARNING, "SysV semaphore %ld does not (any longer) exist", Z_LVAL_P(arg_id)); + php_error_docref(NULL, E_WARNING, "SysV semaphore " ZEND_LONG_FMT " does not (any longer) exist", Z_LVAL_P(arg_id)); RETURN_FALSE; } @@ -397,7 +397,7 @@ PHP_FUNCTION(sem_remove) #else if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) { #endif - php_error_docref(NULL, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_P(arg_id), strerror(errno)); + php_error_docref(NULL, E_WARNING, "failed for SysV sempphore " ZEND_LONG_FMT ": %s", Z_LVAL_P(arg_id), strerror(errno)); RETURN_FALSE; } |