[hackers] [sbase] flock: Set default mode for open(2) || sin

From: <git_AT_suckless.org>
Date: Wed, 7 Oct 2015 11:28:16 +0200 (CEST)

commit 386fa3d2a767a23cbd8d7ce67dbd6a953ff45032
Author: sin <sin_AT_2f30.org>
AuthorDate: Wed Oct 7 10:22:46 2015 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Oct 7 10:27:47 2015 +0100

    flock: Set default mode for open(2)

diff --git a/flock.c b/flock.c
index f81a551..190d3b1 100644
--- a/flock.c
+++ b/flock.c
_AT_@ -40,7 +40,7 @@ main(int argc, char *argv[])
         if (argc < 2)
                 usage();
 
- if ((fd = open(*argv, O_RDONLY | O_CREAT)) < 0)
+ if ((fd = open(*argv, O_RDONLY | O_CREAT, 0644)) < 0)
                 eprintf("open %s:", *argv);
 
         if (flock(fd, flags | nonblk)) {
Received on Wed Oct 07 2015 - 11:28:16 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 07 2015 - 11:36:12 CEST