]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/semaphore.h
Opt: Make OPT_LAST_ARG actually work and document interface of opt_parse()
[libucw.git] / ucw / semaphore.h
index a2bc8959118f84d66eee67a6b976a5a75511ad06..7b211f8e1c9d1d3a0b746bad68531074b87c9c41 100644 (file)
 #include <stdio.h>
 #include <errno.h>
 
-#include "ucw/fastbuf.h" // For the temp_file_name
+#include <ucw/fastbuf.h> // For the temp_file_name
 
 /* In Darwin, sem_init() is unfortunately not implemented and the guide
  * recommends emulating it using sem_open().  */
 
-static inline sem_t *
-sem_alloc(void)
+static inline sem_t *sem_alloc(void)
 {
   char buf[TEMP_FILE_NAME_LEN];
   int mode, retry = 10;
@@ -39,16 +38,14 @@ sem_alloc(void)
   return sem;
 }
 
-static inline void
-sem_free(sem_t *sem)
+static inline void sem_free(sem_t *sem)
 {
   sem_close(sem);
 }
 
 #else
 
-static inline sem_t *
-sem_alloc(void)
+static inline sem_t *sem_alloc(void)
 {
   sem_t *sem = xmalloc(sizeof(sem_t));
   int res = sem_init(sem, 0, 0);
@@ -56,8 +53,7 @@ sem_alloc(void)
   return sem;
 }
 
-static inline void
-sem_free(sem_t *sem)
+static inline void sem_free(sem_t *sem)
 {
   sem_destroy(sem);
   xfree(sem);