windows: fix warning
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 10 May 2012 15:39:22 +0000 (17:39 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 10 May 2012 18:50:14 +0000 (20:50 +0200)
src/main.c: In function 'olsr_create_lock_file':
src/main.c:132:17: error: variable 'lock' set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/main.c

index 230c462..9aae84f 100644 (file)
@@ -129,7 +129,7 @@ struct olsr_cookie_info *def_timer_ci = NULL;
 static int olsr_create_lock_file(bool noExitOnFail) {
 #ifdef WIN32
     bool success;
-    HANDLE lck, lock;
+    HANDLE lck;
 
     lck = CreateFile(lock_file_name,
             GENERIC_READ | GENERIC_WRITE,
@@ -139,7 +139,7 @@ static int olsr_create_lock_file(bool noExitOnFail) {
             FILE_ATTRIBUTE_NORMAL |
             FILE_FLAG_DELETE_ON_CLOSE,
             NULL);
-  lock = CreateEvent(NULL, TRUE, FALSE, lock_file_name);
+  CreateEvent(NULL, TRUE, FALSE, lock_file_name);
   if (INVALID_HANDLE_VALUE == lck || ERROR_ALREADY_EXISTS == GetLastError()) {
     if (noExitOnFail) {
       return -1;