Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: src/untrusted/pthread/nc_semaphore.c

Issue 18711004: libpthread: Remove unneeded NULL checks from semaphore functions (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/syscalls/semaphore_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/pthread/nc_semaphore.c
diff --git a/src/untrusted/pthread/nc_semaphore.c b/src/untrusted/pthread/nc_semaphore.c
index 84a31f78f94443929f11709c63cc651070d95cf9..635dc859bc5c5fe4ca1b0504951001d6e9418e6d 100644
--- a/src/untrusted/pthread/nc_semaphore.c
+++ b/src/untrusted/pthread/nc_semaphore.c
@@ -46,10 +46,6 @@
/* Initialize semaphore */
int sem_init(sem_t *sem, int pshared, unsigned int value) {
- if (NULL == sem) {
- errno = EINVAL;
- return -1;
- }
if (pshared) {
/* We don't support shared semaphores yet. */
errno = ENOSYS;
@@ -65,10 +61,6 @@ int sem_init(sem_t *sem, int pshared, unsigned int value) {
}
int sem_destroy(sem_t *sem) {
- if (NULL == sem) {
- errno = EINVAL;
- return -1;
- }
if (sem->nwaiters != 0) {
errno = EBUSY;
return -1;
@@ -87,11 +79,6 @@ static int decrement_if_positive(volatile int *ptr) {
}
int sem_wait(sem_t *sem) {
- if (NULL == sem) {
- errno = EINVAL;
- return -1;
- }
-
if (decrement_if_positive(&sem->count))
return 0;
@@ -104,11 +91,6 @@ int sem_wait(sem_t *sem) {
}
int sem_post(sem_t *sem) {
- if (NULL == sem) {
- errno = EINVAL;
- return -1;
- }
-
/* Increment sem->count, checking for overflow. */
int old_value;
do {
« no previous file with comments | « no previous file | tests/syscalls/semaphore_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698