X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fsem.c;h=563cea6d592f9361566c6c73e3578bf35b09d41f;hb=5e1b777ab504b5ab4428e5850bc03039f0e680ff;hp=86fe39882c54a315e04a2f0b773f0b08db4aa801;hpb=b5aeb6f8ea2147f64be9a8ce750917aed4bf7cef;p=tlsproxy%2Ftlsproxy.git
diff --git a/src/sem.c b/src/sem.c
index 86fe398..563cea6 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-2012 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;
}