Changeset 75
- Timestamp:
- 2006-06-08T09:16:19+02:00 (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
-
Makefile.frag (modified) (1 diff)
-
foreachcoresig.h (added)
-
xcache.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.frag
r53 r75 32 32 disassembler.lo: $(XCACHE_PROC_H) $(srcdir)/processor.c 33 33 34 $(builddir)/xcache.lo: $(XCACHE_PROC_H) $(srcdir)/myshm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c 35 xcache.lo: $(XCACHE_PROC_H) $(srcdir)/myshm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c 34 $(builddir)/xcache.lo: $(XCACHE_PROC_H) $(srcdir)/myshm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c $(srcdir)/foreachcoresig.h 35 xcache.lo: $(XCACHE_PROC_H) $(srcdir)/myshm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c $(srcdir)/foreachcoresig.h 36 37 xcachesvnclean: clean 38 cat $(srcdir)/.cvsignore | grep -v Makefile | xargs rm -f -
trunk/xcache.c
r65 r75 509 509 int cacheid; 510 510 xc_entry_data_php_t *php; 511 char *ptr; 511 512 512 513 if (!filename || !SG(request_info).path_translated) { … … 523 524 } 524 525 526 /* absolute path */ 525 527 pbuf = &buf; 526 528 if (IS_ABSOLUTE_PATH(filename, strlen(filename))) { … … 528 530 return 0; 529 531 } 530 } 531 else { 532 if (xc_stat(filename, PG(include_path), pbuf TSRMLS_CC) != 0) { 532 break; 533 } 534 535 /* relative path */ 536 if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) { 537 ptr = filename + 1; 538 if (*ptr == '.') { 539 while (*(++ptr) == '.'); 540 if (!IS_SLASH(*ptr)) { 541 goto not_relative_path; 542 } 543 } 544 545 if (VCWD_STAT(filename, pbuf) != 0) { 533 546 return 0; 534 547 } 548 break; 549 } 550 not_relative_path: 551 552 /* use include_path */ 553 if (xc_stat(filename, PG(include_path), pbuf TSRMLS_CC) != 0) { 554 return 0; 535 555 } 536 556 } while (0); … … 607 627 cache->clogs ++; /* is it safe here? */ 608 628 return origin_compile_file(h, type TSRMLS_CC); 629 } 630 631 if (php_check_open_basedir(filename TSRMLS_CC) != 0) { 632 return NULL; 609 633 } 610 634 … … 1720 1744 /* }}} */ 1721 1745 1722 /* signal handler */ 1723 static void (*original_sigsegv_handler)(int) = NULL; 1724 static void xcache_sigsegv_handler(int sig) /* {{{ */ 1725 { 1726 if (original_sigsegv_handler != xcache_sigsegv_handler) { 1727 signal(SIGSEGV, original_sigsegv_handler); 1728 } 1729 else { 1730 signal(SIGSEGV, SIG_DFL); 1731 } 1746 /* old signal handlers {{{ */ 1747 typedef void (*xc_sighandler_t)(int); 1748 #define FOREACH_SIG(sig) static xc_sighandler_t old_##sig##_handler = NULL 1749 #include "foreachcoresig.h" 1750 #undef FOREACH_SIG 1751 /* }}} */ 1752 static void xcache_signal_handler(int sig); 1753 static void xcache_restore_signal_handler() /* {{{ */ 1754 { 1755 #define FOREACH_SIG(sig) do { \ 1756 if (old_##sig##_handler != xcache_signal_handler) { \ 1757 signal(sig, old_##sig##_handler); \ 1758 } \ 1759 else { \ 1760 signal(sig, SIG_DFL); \ 1761 } \ 1762 } while (0) 1763 #include "foreachcoresig.h" 1764 #undef FOREACH_SIG 1765 } 1766 /* }}} */ 1767 static void xcache_init_signal_handler() /* {{{ */ 1768 { 1769 #define FOREACH_SIG(sig) \ 1770 old_##sig##_handler = signal(sig, xcache_signal_handler) 1771 #include "foreachcoresig.h" 1772 #undef FOREACH_SIG 1773 } 1774 /* }}} */ 1775 static void xcache_signal_handler(int sig) /* {{{ */ 1776 { 1777 xcache_restore_signal_handler(); 1732 1778 if (xc_coredump_dir && xc_coredump_dir[0]) { 1733 1779 chdir(xc_coredump_dir); … … 1901 1947 1902 1948 if (xc_coredump_dir && xc_coredump_dir[0]) { 1903 original_sigsegv_handler = signal(SIGSEGV, xcache_sigsegv_handler);1949 xcache_init_signal_handler(); 1904 1950 } 1905 1951 … … 1941 1987 1942 1988 if (xc_coredump_dir && xc_coredump_dir[0]) { 1943 signal(SIGSEGV, original_sigsegv_handler);1989 xcache_restore_signal_handler(); 1944 1990 } 1945 1991 if (xc_coredump_dir) {
Note: See TracChangeset
for help on using the changeset viewer.

