X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fsem.c;h=3c911cde10ff820ca06247df2d91b3b18e93422e;hb=a64101800c79c852cc4ab9d445c35aad0a6457eb;hp=86fe39882c54a315e04a2f0b773f0b08db4aa801;hpb=b5aeb6f8ea2147f64be9a8ce750917aed4bf7cef;p=tlsproxy%2Ftlsproxy.git
diff --git a/src/sem.c b/src/sem.c
index 86fe398..3c911cd 100644
--- a/src/sem.c
+++ b/src/sem.c
@@ -1,7 +1,7 @@
/*
* Simple semaphore implementation, P() and V().
*
- * Copyright (C) 2011 Simon Ruderich
+ * Copyright (C) 2011-2013 Simon Ruderich
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,11 +17,11 @@
* along with this program. If not, see .
*/
+#include "sem.h"
+
#include
#include
-#include "sem.h"
-
struct SEM {
pthread_mutex_t mutex;
@@ -30,7 +30,7 @@ struct SEM {
};
SEM *sem_init(int init_value) {
- SEM *sem = (SEM *)malloc(sizeof(SEM));
+ SEM *sem = malloc(sizeof(*sem));
if (NULL == sem) {
return NULL;
}