main: olsr_create_lock_file: fix return value check on 'open' call
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 8 Nov 2013 15:11:01 +0000 (16:11 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 8 Nov 2013 15:16:56 +0000 (16:16 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/main.c

index 820549b..5bb26a2 100644 (file)
@@ -180,7 +180,7 @@ static int olsr_create_lock_file(bool noExitOnFail) {
 
   /* create file for lock */
   lock_fd = open(lock_file_name, O_WRONLY | O_CREAT, S_IRWXU);
-  if (lock_fd == 0) {
+  if (lock_fd < 0) {
     if (noExitOnFail) {
       return -1;
     }