Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Dec 2015 11:55:39 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r292510 - head/lib/libc/gen
Message-ID:  <201512201155.tBKBtdEx013192@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Dec 20 11:55:39 2015
New Revision: 292510
URL: https://svnweb.freebsd.org/changeset/base/292510

Log:
  Fix lockf(3) cancellation behaviour.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/lib/libc/gen/lockf.c

Modified: head/lib/libc/gen/lockf.c
==============================================================================
--- head/lib/libc/gen/lockf.c	Sun Dec 20 06:29:03 2015	(r292509)
+++ head/lib/libc/gen/lockf.c	Sun Dec 20 11:55:39 2015	(r292510)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include <fcntl.h>
 #include <unistd.h>
 #include "un-namespace.h"
+#include "libc_private.h"
 
 int
 lockf(int filedes, int function, off_t size)
@@ -62,9 +63,12 @@ lockf(int filedes, int function, off_t s
 		break;
 	case F_TEST:
 		fl.l_type = F_WRLCK;
-		if (_fcntl(filedes, F_GETLK, &fl) == -1)
+		if (((int (*)(int, int, ...))
+		    __libc_interposing[INTERPOS_fcntl])(filedes, F_GETLK, &fl)
+		    == -1)
 			return (-1);
-		if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 && fl.l_pid == getpid()))
+		if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 &&
+		    fl.l_pid == getpid()))
 			return (0);
 		errno = EAGAIN;
 		return (-1);
@@ -75,5 +79,6 @@ lockf(int filedes, int function, off_t s
 		/* NOTREACHED */
 	}
 
-	return (_fcntl(filedes, cmd, &fl));
+	return (((int (*)(int, int, ...))
+	    __libc_interposing[INTERPOS_fcntl])(filedes, cmd, &fl));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512201155.tBKBtdEx013192>