summaryrefslogtreecommitdiff
path: root/usr/src/ucblib/libucb/port
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-02-18 19:52:21 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2015-02-18 19:52:21 +0000
commitade223c09cba5f3d8f633e5f451a8412ecd8917b (patch)
treef4076aaea4aaed50d3406b6a2168ac3079179dd8 /usr/src/ucblib/libucb/port
parent3f8d3031925da0b8a20186fff1da8a615aaf4470 (diff)
downloadillumos-joyent-ade223c09cba5f3d8f633e5f451a8412ecd8917b.tar.gz
OS-2868 Need a proper flock() implementation
Diffstat (limited to 'usr/src/ucblib/libucb/port')
-rw-r--r--usr/src/ucblib/libucb/port/sys/flock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr/src/ucblib/libucb/port/sys/flock.c b/usr/src/ucblib/libucb/port/sys/flock.c
index ee473bf2f8..364d4f1f5f 100644
--- a/usr/src/ucblib/libucb/port/sys/flock.c
+++ b/usr/src/ucblib/libucb/port/sys/flock.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2015 Joyent, Inc.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -33,9 +34,9 @@
/*LINTLIBRARY*/
+#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/file.h>
-#include <sys/fcntl.h>
#include <errno.h>
int
@@ -51,12 +52,11 @@ flock(int fd, int operation)
fl.l_len = 0;
fl.l_type = 0;
- /* In non-blocking lock, use F_SETLK for cmd, F_SETLKW otherwise */
if (operation & LOCK_NB) {
- cmd = F_SETLK;
+ cmd = F_FLOCK;
operation &= ~LOCK_NB; /* turn off this bit */
} else
- cmd = F_SETLKW;
+ cmd = F_FLOCKW;
switch (operation) {
case LOCK_UN: