]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/semaphore.h
Fastbuf: Rewritten bprintf()
[libucw.git] / ucw / semaphore.h
index 140ba9b9f09c055926273df884655076bbfb56e2..cd01512c0ff10c7bd8d97ce918ac823403ad3198 100644 (file)
@@ -18,7 +18,7 @@
 #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().  */
@@ -28,10 +28,11 @@ sem_alloc(void)
 {
   char buf[TEMP_FILE_NAME_LEN];
   int mode, retry = 10;
+  sem_t *sem;
   do
     {
       temp_file_name(buf, &mode);
-      sem_t *sem = sem_open(buf, mode | O_CREAT, 0777, 0);
+      sem = sem_open(buf, mode | O_CREAT, 0777, 0);
     }
   while (sem == (sem_t*) SEM_FAILED && errno == EEXIST && retry --);
   ASSERT(sem != (sem_t*) SEM_FAILED);