]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(main): Fixed file locking.
authorNiels Möller <nisse@lysator.liu.se>
Thu, 30 Oct 2008 16:50:45 +0000 (17:50 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 30 Oct 2008 16:50:45 +0000 (17:50 +0100)
Rev: nettle/tools/sexp-conv.c:1.3

tools/sexp-conv.c

index e156877ce55736129cd2647be509baed1f38e565..d6ebef0368487756fe0fd632d3a7424f4f6674cc 100644 (file)
@@ -380,8 +380,13 @@ main(int argc, char **argv)
       struct flock fl;
   
       memset(&fl, 0, sizeof(fl));
+      fl.l_type = F_WRLCK;
+      fl.l_whence = SEEK_SET;
+      fl.l_start = 0;
+      fl.l_len = 0; /* Means entire file. */
+      
       if (fcntl(STDOUT_FILENO, F_SETLKW, &fl) == -1)
-       die("Locking output file failed: $s\n", strerror(errno));
+       die("Locking output file failed: %s\n", strerror(errno));
     }
 #endif /* HAVE_FCNTL_LOCKING */
   if (options.hash)