git » libfilo » commit 342ad73

Fix filo_plockf() when unlocking.

author Alberto Bertogli
2005-04-24 00:37:03 UTC
committer Alberto Bertogli
2005-04-24 00:37:03 UTC
parent bf67c228c33cbf90c25409168b90bc2ebf930ec6

Fix filo_plockf() when unlocking.

libfilo.c +1 -3

diff --git a/libfilo.c b/libfilo.c
index 67c62cf..be41ae3 100644
--- a/libfilo.c
+++ b/libfilo.c
@@ -472,15 +472,13 @@ int filo_unlock(filock_t *fl, off_t start, off_t len)
 
 int filo_plockf(filock_t *fl, int cmd, off_t start, off_t len)
 {
-	int mode, rv;
+	int rv, mode = 0;
 	off_t end = start + len;
 
 	if (cmd & _FL_READ)
 		mode = FL_RD_MODE;
 	else if (cmd & _FL_WRITE)
 		mode = FL_WR_MODE;
-	else
-		return -1;
 
 	if (cmd & _FL_LOCK)
 		rv = filo_lock(fl, start, len, mode);