]> mj.ucw.cz Git - libucw.git/commitdiff
ucw/semaphore.h doesn't compile with gcc-4.0; the fix is trivial
authorRobert Spalek <robert@ucw.cz>
Fri, 24 Oct 2008 07:32:40 +0000 (00:32 -0700)
committerRobert Spalek <robert@ucw.cz>
Fri, 24 Oct 2008 07:32:40 +0000 (00:32 -0700)
ucw/semaphore.h

index 140ba9b9f09c055926273df884655076bbfb56e2..a2bc8959118f84d66eee67a6b976a5a75511ad06 100644 (file)
@@ -28,10 +28,11 @@ sem_alloc(void)
 {
   char buf[TEMP_FILE_NAME_LEN];
   int mode, retry = 10;
 {
   char buf[TEMP_FILE_NAME_LEN];
   int mode, retry = 10;
+  sem_t *sem;
   do
     {
       temp_file_name(buf, &mode);
   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);
     }
   while (sem == (sem_t*) SEM_FAILED && errno == EEXIST && retry --);
   ASSERT(sem != (sem_t*) SEM_FAILED);