From 58ebbf0a711055b4b199d1c2b0f6d190684b3b30 Mon Sep 17 00:00:00 2001 From: szy Date: Mon, 13 Dec 2021 01:52:13 -0800 Subject: [PATCH] =?UTF-8?q?=20=20=20=20fix:=20=E8=A7=A3=E5=86=B3=E5=AE=8F?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=5FSEM=5FMAGIC=E6=95=B0=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: suzongyao --- kal/posix/src/semaphore.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kal/posix/src/semaphore.c b/kal/posix/src/semaphore.c index 52145a92..3fd73696 100644 --- a/kal/posix/src/semaphore.c +++ b/kal/posix/src/semaphore.c @@ -82,7 +82,7 @@ int sem_init(sem_t *sem, int shared, unsigned int value) return -1; } - sem->s_magic = _SEM_MAGIC; + sem->s_magic = (int)_SEM_MAGIC; sem->s_handle = (int)semHandle; return 0; @@ -92,7 +92,7 @@ int sem_destroy(sem_t *sem) { UINT32 ret; - if ((sem == NULL) || (sem->s_magic != _SEM_MAGIC)) { + if ((sem == NULL) || (sem->s_magic != (int)_SEM_MAGIC)) { errno = EINVAL; return -1; } @@ -109,7 +109,7 @@ int sem_wait(sem_t *sem) { UINT32 ret; - if ((sem == NULL) || (sem->s_magic != _SEM_MAGIC)) { + if ((sem == NULL) || (sem->s_magic != (int)_SEM_MAGIC)) { errno = EINVAL; return -1; } @@ -126,7 +126,7 @@ int sem_post(sem_t *sem) { UINT32 ret; - if ((sem == NULL) || (sem->s_magic != _SEM_MAGIC)) { + if ((sem == NULL) || (sem->s_magic != (int)_SEM_MAGIC)) { errno = EINVAL; return -1; } @@ -159,7 +159,7 @@ int sem_timedwait(sem_t *sem, const struct timespec *timeout) UINT32 ret; long long tickCnt; - if ((sem == NULL) || (sem->s_magic != _SEM_MAGIC)) { + if ((sem == NULL) || (sem->s_magic != (int)_SEM_MAGIC)) { errno = EINVAL; return -1; }