summaryrefslogtreecommitdiff
path: root/nacl/curvecp/open_lock.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-13 10:09:38 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-13 10:09:38 -0400
commitd4fe483efd3e0062f12430efe9deb66d43d914d7 (patch)
treee6aa9ac716ae82cdb15c6e6cb5d9d1d9d29f053b /nacl/curvecp/open_lock.c
parent835ef0320d47372eac14bef31c979b8217d04498 (diff)
NaCl moved to other repo.
Diffstat (limited to 'nacl/curvecp/open_lock.c')
-rw-r--r--nacl/curvecp/open_lock.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/nacl/curvecp/open_lock.c b/nacl/curvecp/open_lock.c
deleted file mode 100644
index 898f3b60..00000000
--- a/nacl/curvecp/open_lock.c
+++ /dev/null
@@ -1,19 +0,0 @@
1#include <sys/types.h>
2#include <sys/stat.h>
3#include <unistd.h>
4#include <fcntl.h>
5#include "open.h"
6
7int open_lock(const char *fn)
8{
9#ifdef O_CLOEXEC
10 int fd = open(fn,O_RDWR | O_CLOEXEC);
11 if (fd == -1) return -1;
12#else
13 int fd = open(fn,O_RDWR);
14 if (fd == -1) return -1;
15 fcntl(fd,F_SETFD,1);
16#endif
17 if (lockf(fd,F_LOCK,0) == -1) { close(fd); return -1; }
18 return fd;
19}