Fix missing parameter in open() call
authorHenning Rogge <hrogge@googlemail.com>
Sat, 24 Oct 2009 22:11:45 +0000 (00:11 +0200)
committerHenning Rogge <hrogge@googlemail.com>
Sat, 24 Oct 2009 22:11:45 +0000 (00:11 +0200)
src/main.c

index 239abb6..8c9e9ea 100644 (file)
@@ -42,6 +42,7 @@
 #include <signal.h>
 #include <sys/stat.h>
 #include <assert.h>
+#include <fcntl.h>
 
 #include "ipcalc.h"
 #include "defs.h"
@@ -56,7 +57,6 @@
 #include "net_os.h"
 #include "build_msg.h"
 #include "net_olsr.h"
-#include <fcntl.h>
 
 #if LINUX_POLICY_ROUTING
 #include <linux/types.h>
@@ -112,7 +112,7 @@ static void olsr_create_lock_file(void) {
   struct flock lck;
 
   /* create file for lock */
-  lock_fd = open(lock_file_name, O_WRONLY | O_CREAT);
+  lock_fd = open(lock_file_name, O_WRONLY | O_CREAT, S_IRWXU);
   if (lock_fd == 0) {
     close(lock_fd);
     fprintf(stderr,