cvs: pecl /apc apc_fcntl.c config.m4

From: Date: Sat, 28 Jun 2003 16:43:02 +0000
Subject: cvs: pecl /apc apc_fcntl.c config.m4
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-343@lists.php.net to get a copy of this message
gschlossnagle Sat Jun 28 12:43:02 2003 EDT Modified files: /pecl/apc config.m4 apc_fcntl.c Log: improve error handling. make fcntl locks default. Index: pecl/apc/config.m4 diff -u pecl/apc/config.m4:3.7 pecl/apc/config.m4:3.8 --- pecl/apc/config.m4:3.7 Fri Jun 27 12:02:11 2003 +++ pecl/apc/config.m4 Sat Jun 28 12:43:02 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 3.7 2003/06/27 16:02:11 gschlossnagle Exp $ +dnl $Id: config.m4,v 3.8 2003/06/28 16:43:02 gschlossnagle Exp $ dnl PHP_ARG_ENABLE(apc, for APC support, @@ -41,11 +41,11 @@ AC_MSG_RESULT(no) ]) -AC_MSG_CHECKING(whether to prefer fcntl based locks) +AC_MSG_CHECKING(whether to prefer semaphore based locks) AC_ARG_ENABLE(fcntl, -[ --enable-fcntl Enable fcntl support instead of IPC sem],[ +[ --enable-sem Enable IPC semamphore based locks instead of standard locks],[ if test "$enableval" = "yes" ; then - AC_DEFINE(APC_FCNTL_LOCKS, 1, [ ]) + AC_DEFINE(APC_SEM_LOCKS, 1, [ ]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) Index: pecl/apc/apc_fcntl.c diff -u pecl/apc/apc_fcntl.c:3.14 pecl/apc/apc_fcntl.c:3.15 --- pecl/apc/apc_fcntl.c:3.14 Fri Jun 27 12:19:18 2003 +++ pecl/apc/apc_fcntl.c Sat Jun 28 12:43:02 2003 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: apc_fcntl.c,v 3.14 2003/06/27 16:19:18 gschlossnagle Exp $ */ +/* $Id: apc_fcntl.c,v 3.15 2003/06/28 16:43:02 gschlossnagle Exp $ */ #include "apc_fcntl.h" #include "apc.h" @@ -58,12 +58,16 @@ void apc_fcntl_lock(int fd) { - lock_reg(fd, F_SETLKW, F_WRLCK, 0, SEEK_SET, 1); + if(lock_reg(fd, F_SETLKW, F_WRLCK, 0, SEEK_SET, 1) < 0) { + apc_eprint("apc_fcntl_lock failed errno:%d", errno); + } } void apc_fcntl_unlock(int fd) { - lock_reg(fd, F_SETLK, F_UNLCK, 0, SEEK_SET, 1); + if(lock_reg(fd, F_SETLK, F_UNLCK, 0, SEEK_SET, 1) < 0) { + apc_eprint("apc_fcntl_unlock failed errno:%d", errno); + } } /*

« previous php.pecl.cvs (#343) next »