cvs: pecl /apc apc_fcntl.c apc_main.c php_apc.c
| From: | Rasmus Lerdorf | Date: | Sun, 12 Sep 2004 13:20:56 +0000 |
| Subject: | cvs: pecl /apc apc_fcntl.c apc_main.c php_apc.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-1823@lists.php.net to get a copy of this message | ||
rasmus Sun Sep 12 09:20:56 2004 EDT
Modified files:
/pecl/apc apc_fcntl.c apc_main.c php_apc.c
Log:
Fix a couple of compiler warnings
http://cvs.php.net/diff.php/pecl/apc/apc_fcntl.c?r1=3.17&r2=3.18&ty=u
Index: pecl/apc/apc_fcntl.c
diff -u pecl/apc/apc_fcntl.c:3.17 pecl/apc/apc_fcntl.c:3.18
--- pecl/apc/apc_fcntl.c:3.17 Sat Sep 11 22:56:58 2004
+++ pecl/apc/apc_fcntl.c Sun Sep 12 09:20:56 2004
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apc_fcntl.c,v 3.17 2004/09/12 02:56:58 rasmus Exp $ */
+/* $Id: apc_fcntl.c,v 3.18 2004/09/12 13:20:56 rasmus Exp $ */
#include "apc_fcntl.h"
#include "apc.h"
@@ -24,18 +24,25 @@
int apc_fcntl_create(const char* pathname)
{
int fd;
- char *lock_path = pathname;
+ char *lock_path = NULL;
if(pathname == NULL) {
lock_path = malloc(strlen("/tmp/.apc.") + 6);
snprintf(lock_path, strlen("/tmp/.apc.") + 6, "/tmp/.apc.%d",
getpid());
+ fd = open(lock_path, O_RDWR|O_CREAT, 0666);
+ if(fd > 0 ) {
+ unlink(lock_path);
+ return fd;
+ } else {
+ apc_eprint("apc_fcntl_create: open(%s, O_RDWR|O_CREAT, 0666) failed:",
lock_path);
+ return -1;
+ }
}
- fd = open(lock_path, O_RDWR|O_CREAT, 0666);
+ fd = open(pathname, O_RDWR|O_CREAT, 0666);
if(fd > 0 ) {
- unlink(lock_path);
+ unlink(pathname);
return fd;
- } else {
- apc_eprint("apc_fcntl_create: open(%s, O_RDWR|O_CREAT, 0666) failed:",
lock_path);
}
+ apc_eprint("apc_fcntl_create: open(%s, O_RDWR|O_CREAT, 0666) failed:", pathname);
return -1;
}
http://cvs.php.net/diff.php/pecl/apc/apc_main.c?r1=3.20&r2=3.21&ty=u
Index: pecl/apc/apc_main.c
diff -u pecl/apc/apc_main.c:3.20 pecl/apc/apc_main.c:3.21
--- pecl/apc/apc_main.c:3.20 Sat Sep 11 22:56:58 2004
+++ pecl/apc/apc_main.c Sun Sep 12 09:20:56 2004
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apc_main.c,v 3.20 2004/09/12 02:56:58 rasmus Exp $ */
+/* $Id: apc_main.c,v 3.21 2004/09/12 13:20:56 rasmus Exp $ */
#include "apc_php.h"
#include "apc_main.h"
@@ -27,6 +27,7 @@
#include "apc_zend.h"
#include "SAPI.h"
#if HAVE_APACHE
+#undef XtOffsetOf
#include "httpd.h"
#endif
http://cvs.php.net/diff.php/pecl/apc/php_apc.c?r1=3.35&r2=3.36&ty=u
Index: pecl/apc/php_apc.c
diff -u pecl/apc/php_apc.c:3.35 pecl/apc/php_apc.c:3.36
--- pecl/apc/php_apc.c:3.35 Sun Sep 12 02:12:17 2004
+++ pecl/apc/php_apc.c Sun Sep 12 09:20:56 2004
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_apc.c,v 3.35 2004/09/12 06:12:17 rasmus Exp $ */
+/* $Id: php_apc.c,v 3.36 2004/09/12 13:20:56 rasmus Exp $ */
#ifdef PHP_WIN32
/* XXX lame hack, for some reason, the ini entries are all messed
@@ -38,6 +38,7 @@
* generates annoying XtOffsetOf warning because of a circular dependency order problem
*/
#if HAVE_APACHE
+#undef XtOffsetOf
#include "httpd.h"
#endif
@@ -121,7 +122,7 @@
#else
php_info_print_table_row(2, "MMAP Support", "Disabled");
#endif
- php_info_print_table_row(2, "Revision", "$Revision: 3.35 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 3.36 $");
php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
DISPLAY_INI_ENTRIES();
php_info_print_table_end();