aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/lockf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/lockf.c')
-rw-r--r--sysdeps/generic/lockf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/generic/lockf.c b/sysdeps/generic/lockf.c
index 6e8851bed7..cc264cda56 100644
--- a/sysdeps/generic/lockf.c
+++ b/sysdeps/generic/lockf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,6 +41,7 @@ lockf (int fd, int cmd, off_t len)
case F_TEST:
/* Test the lock: return 0 if FD is unlocked or locked by this process;
return -1, set errno to EACCES, if another process holds the lock. */
+ fl.l_type = F_RDLCK;
if (__fcntl (fd, F_GETLK, &fl) < 0)
return -1;
if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())