Un po' di materiale su {{{splice}}} e inizio della ripulitura degli
[gapil.git] / sources / Flock.c
index 8ea0ed5f3d320ff112336724b1549a0cb04a6a6c..f20f6df7576d2c691e13e8809083b1eacbefcc0c 100644 (file)
@@ -26,7 +26,7 @@
  *
  * Usage: flock -h give all info's
  *
- * $Id: Flock.c,v 1.2 2002/11/17 17:30:51 piccardi Exp $
+ * $Id: Flock.c,v 1.5 2003/05/02 09:55:13 piccardi Exp $
  *
  *****************************************************************************/
 /*
 #include <stdlib.h>      /* C standard library */
 #include <unistd.h>      /* unix standard library */
 #include <stdio.h>      /* standard I/O library */
-#include <string.h>      /* string functions */
-#include <fcntl.h>       /* string functions */
+#include <string.h>      /* C strings library */
+#include <fcntl.h>       /* file control functions */
+
+
 /* user defined header */
 #include "macros.h"      /* some useful macros */
 
@@ -111,7 +113,7 @@ int main(int argc, char *argv[])
        printf("You should set a read or a write lock\n");
        usage();
     }
-    fd = open(argv[optind], O_RDWR);           /* open the file to be locked */
+    fd = open(argv[optind], O_RDONLY);         /* open the file to be locked */
     if (fd < 0) {                                           /* on error exit */
        perror("Wrong filename");
        exit(1);