From 5bd4cb870fd942fa5e7d9011917032773c43b42a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 21:52:24 +0200 Subject: [PATCH] Update casts from very old my_lock.c source. --- mysys/my_lock.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mysys/my_lock.c b/mysys/my_lock.c index 5058c301adb..8f915d6003a 100644 --- a/mysys/my_lock.c +++ b/mysys/my_lock.c @@ -117,10 +117,12 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length, #if defined(HAVE_FCNTL) { struct flock lock; - lock.l_type= (short) locktype; - lock.l_whence=0L; - lock.l_start=(long) start; - lock.l_len=(long) length; + + lock.l_type= (short) locktype; + lock.l_whence= SEEK_SET; + lock.l_start= (off_t) start; + lock.l_len= (off_t) length; + if (MyFlags & MY_DONT_WAIT) { if (fcntl(fd,F_SETLK,&lock) != -1) /* Check if we can lock */