From 35b99c57f4d50bcfb91126ab2e7520ea29aae6f0 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 30 Oct 2000 06:47:34 +0000 Subject: In the case of F_TEST, set l_type to F_RDLCK explicitly. --- sysdeps/generic/lockf64.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sysdeps/generic') diff --git a/sysdeps/generic/lockf64.c b/sysdeps/generic/lockf64.c index 3d27964879..0caae6ae44 100644 --- a/sysdeps/generic/lockf64.c +++ b/sysdeps/generic/lockf64.c @@ -49,6 +49,7 @@ lockf64 (int fd, int cmd, off64_t len64) 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 ()) -- cgit 1.4.1