mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Return SEM_FAILED instead of NULL, though there are same, but the
SEM_FAILED is more suitable name. In function, sem_close(), always set errno on error.
This commit is contained in:
parent
941e286383
commit
41e160536a
1 changed files with 3 additions and 2 deletions
|
|
@ -147,13 +147,13 @@ _sem_open(const char *name, int flags, ...)
|
|||
|
||||
if (name[0] != '/') {
|
||||
errno = EINVAL;
|
||||
return (NULL);
|
||||
return (SEM_FAILED);
|
||||
}
|
||||
name++;
|
||||
|
||||
if (flags & ~(O_CREAT|O_EXCL)) {
|
||||
errno = EINVAL;
|
||||
return (NULL);
|
||||
return (SEM_FAILED);
|
||||
}
|
||||
|
||||
_pthread_once(&once, sem_module_init);
|
||||
|
|
@ -275,6 +275,7 @@ _sem_close(sem_t *sem)
|
|||
return (0);
|
||||
}
|
||||
_pthread_mutex_unlock(&sem_llock);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue