head 1.9; access; symbols OPENPKG_E1_MP_HEAD:1.2 OPENPKG_E1_MP:1.2 OPENPKG_E1_MP_2_STABLE:1.2.2.2 OPENPKG_E1_FP:1.2.2.2 OPENPKG_2_STABLE_MP:1.2 OPENPKG_2_STABLE_20061018:1.2.2.2 OPENPKG_2_STABLE:1.2.0.2; locks; strict; comment @# @; 1.9 date 2009.03.27.12.15.30; author rse; state Exp; branches; next 1.8; commitid N6PWDB4SrVf4sFHt; 1.8 date 2008.10.18.18.18.51; author rse; state Exp; branches; next 1.7; commitid XbBShXg6ZCWzB8nt; 1.7 date 2008.09.25.07.20.25; author rse; state Exp; branches; next 1.6; commitid COLLtYuGLRgxH7kt; 1.6 date 2007.12.20.16.40.08; author cs; state Exp; branches; next 1.5; commitid XAzPKFYB8QMyNbKs; 1.5 date 2007.10.06.08.46.47; author rse; state Exp; branches; next 1.4; commitid DwYm8iF0tcwDAvAs; 1.4 date 2007.08.21.21.06.42; author cs; state Exp; branches; next 1.3; commitid sACjPcg4GvZ8aFus; 1.3 date 2007.07.20.19.28.11; author cs; state Exp; branches; next 1.2; commitid pF8IqQqlrhZ7Exqs; 1.2 date 2006.10.11.20.53.42; author rse; state Exp; branches 1.2.2.1; next 1.1; commitid 1UuJRfzvzzerbjQr; 1.1 date 2006.10.11.18.04.03; author cs; state Exp; branches; next ; commitid t5LGHrbqNGNffiQr; 1.2.2.1 date 2006.10.11.20.53.42; author rse; state dead; branches; next 1.2.2.2; commitid iZxwRSmmWscPXUQr; 1.2.2.2 date 2006.10.16.14.57.43; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; desc @@ 1.9 log @upgrading package: varnish 2.0.2 -> 2.0.3 @ text @Index: bin/varnishd/common.h --- bin/varnishd/common.h.orig 2009-02-12 12:15:25 +0100 +++ bin/varnishd/common.h 2009-03-27 13:09:35 +0100 @@@@ -52,3 +52,8 @@@@ fprintf(stderr, "Error: " __VA_ARGS__); \ exit(2); \ } while (0); + +#ifndef NAN +#define NAN (__builtin_nanf("")) +#endif + Index: bin/varnishd/mgt_child.c --- bin/varnishd/mgt_child.c.orig 2009-02-12 12:15:25 +0100 +++ bin/varnishd/mgt_child.c 2009-03-27 13:09:35 +0100 @@@@ -238,6 +238,21 @@@@ struct vev *e; int i, cp[2]; +#ifdef OPKG_PIDFILE + { + pid_t pid; + FILE *fp; + + pid = getpid(); + if ((fp = fopen(OPKG_PIDFILE, "w")) == NULL) { + fprintf(stderr, "varnishd:ERROR: cannot write PID file '%s'\n", OPKG_PIDFILE); + exit(1); + } + fprintf(fp, "%ld\n", (long)pid); + fclose(fp); + } +#endif + if (child_state != CH_STOPPED && child_state != CH_DIED) return; Index: configure --- configure.orig 2009-02-12 12:15:43 +0100 +++ configure 2009-03-27 13:10:04 +0100 @@@@ -26417,9 +26417,6 @@@@ VCC_CC="$ac_cv_env_VCC_CC_value" else case $target in - *-*-solaris*) - VCC_CC="cc -Kpic -G -o %o %s" - ;; *-*-darwin*) VCC_CC="exec cc -dynamiclib -Wl,-undefined,dynamic_lookup -o %o %s" ;; @ 1.8 log @upgrading package: varnish 2.0b2 -> 2.0.1 @ text @d2 2 a3 2 --- bin/varnishd/common.h.orig 2008-10-17 20:59:49 +0200 +++ bin/varnishd/common.h 2008-10-18 20:14:49 +0200 d14 3 a16 3 --- bin/varnishd/mgt_child.c.orig 2008-10-17 20:59:49 +0200 +++ bin/varnishd/mgt_child.c 2008-10-18 20:14:49 +0200 @@@@ -239,6 +239,21 @@@@ d39 3 a41 3 --- configure.orig 2008-10-17 21:00:05 +0200 +++ configure 2008-10-18 20:15:14 +0200 @@@@ -26612,9 +26612,6 @@@@ d44 1 a44 1 case $host in @ 1.7 log @upgrading package: varnish 1.1.2 -> 2.0b2 @ text @d2 2 a3 2 --- bin/varnishd/common.h.orig 2008-09-24 20:05:20 +0200 +++ bin/varnishd/common.h 2008-09-25 09:14:05 +0200 d14 2 a15 2 --- bin/varnishd/mgt_child.c.orig 2008-09-24 20:05:20 +0200 +++ bin/varnishd/mgt_child.c 2008-09-25 09:14:05 +0200 d39 12 a50 12 --- configure.orig 2008-09-24 20:36:08 +0200 +++ configure 2008-09-25 09:16:28 +0200 @@@@ -26605,9 +26605,6 @@@@ # to figure this out dynamically without introducing a run-time # dependency on libtool. case $host in -*-*-solaris*) - VCC_CC="cc -Kpic ${CFLAGS} -G -o %o %s" - ;; *-*-darwin*) VCC_CC="exec cc -dynamiclib -Wl,-undefined,dynamic_lookup -o %o %s" ;; @ 1.6 log @upgrading package: varnish 1.1.1 -> 1.1.2 @ text @d2 6 a7 6 --- bin/varnishd/common.h.orig 2007-08-20 22:05:40 +0200 +++ bin/varnishd/common.h 2007-10-06 10:39:12 +0200 @@@@ -44,3 +44,8 @@@@ void TCP_name(struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen); void TCP_myname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen); int TCP_filter_http(int sock); d14 5 a18 5 --- bin/varnishd/mgt_child.c.orig 2007-08-20 22:05:40 +0200 +++ bin/varnishd/mgt_child.c 2007-10-06 10:39:12 +0200 @@@@ -217,6 +217,21 @@@@ fprintf(stderr, "start child pid %jd\n", (intmax_t)pid); d35 2 a36 2 AZ(close(child_fds[1])); child_fds[1] = -1; d38 13 a50 12 Index: bin/varnishd/mgt_vcc.c --- bin/varnishd/mgt_vcc.c.orig 2007-08-20 22:05:39 +0200 +++ bin/varnishd/mgt_vcc.c 2007-10-06 10:39:12 +0200 @@@@ -184,7 +184,7 @@@@ #ifdef __APPLE__ "exec cc -dynamiclib -Wl,-flat_namespace,-undefined,suppress -o %s -x c - < %s 2>&1", #else - "exec cc -fpic -shared -Wl,-x -o %s -x c - < %s 2>&1", + "exec @@l_cc@@ -fpic -shared -Wl,-x -o %s -x c - < %s 2>&1", #endif sf, of, sf); xxxassert(len < sizeof buf); @ 1.5 log @port to Sun Solaris; remove some unnecessary sub-shell constructs and move the overriding subst to %build to allow one to more easily patch varnish @ text @a49 184 Index: bin/varnishd/storage_file.c --- bin/varnishd/storage_file.c.orig 2007-08-20 22:05:39 +0200 +++ bin/varnishd/storage_file.c 2007-10-06 10:39:12 +0200 @@@@ -116,7 +116,11 @@@@ static void smf_calcsize(struct smf_sc *sc, const char *size, int newfile) { +#if defined(__sun__) + struct statvfs fsst; +#else struct statfs fsst; +#endif uintmax_t l, fssize; unsigned bs; char suff[2]; Index: include/compat/daemon.h --- /dev/null 2007-10-06 10:39:16 +0200 +++ include/compat/daemon.h 2007-10-06 10:39:12 +0200 @@@@ -0,0 +1,8 @@@@ +#ifndef _DAEMON_H_ +#define _DAEMON_H_ + +#ifndef HAVE_DAEMON +extern int daemon(int, int); +#endif + +#endif Index: lib/libvarnishcompat/Makefile.in --- lib/libvarnishcompat/Makefile.in.orig 2007-08-20 22:05:59 +0200 +++ lib/libvarnishcompat/Makefile.in 2007-10-06 10:39:12 +0200 @@@@ -57,6 +57,7 @@@@ am_libvarnishcompat_la_OBJECTS = libvarnishcompat_la-asprintf.lo \ libvarnishcompat_la-vasprintf.lo \ libvarnishcompat_la-setproctitle.lo \ + libvarnishcompat_la-daemon.lo \ libvarnishcompat_la-srandomdev.lo \ libvarnishcompat_la-strlcat.lo libvarnishcompat_la-strlcpy.lo \ libvarnishcompat_la-strndup.lo libvarnishcompat_la-vis.lo @@@@ -203,6 +204,7 @@@@ asprintf.c \ vasprintf.c \ setproctitle.c \ + daemon.c \ srandomdev.c \ strlcat.c \ strlcpy.c \ @@@@ -281,6 +283,7 @@@@ @@AMDEP_TRUE@@@@am__include@@ @@am__quote@@./$(DEPDIR)/libvarnishcompat_la-asprintf.Plo@@am__quote@@ @@AMDEP_TRUE@@@@am__include@@ @@am__quote@@./$(DEPDIR)/libvarnishcompat_la-setproctitle.Plo@@am__quote@@ +@@AMDEP_TRUE@@@@am__include@@ @@am__quote@@./$(DEPDIR)/libvarnishcompat_la-daemon.Plo@@am__quote@@ @@AMDEP_TRUE@@@@am__include@@ @@am__quote@@./$(DEPDIR)/libvarnishcompat_la-srandomdev.Plo@@am__quote@@ @@AMDEP_TRUE@@@@am__include@@ @@am__quote@@./$(DEPDIR)/libvarnishcompat_la-strlcat.Plo@@am__quote@@ @@AMDEP_TRUE@@@@am__include@@ @@am__quote@@./$(DEPDIR)/libvarnishcompat_la-strlcpy.Plo@@am__quote@@ @@@@ -330,6 +333,13 @@@@ @@AMDEP_TRUE@@@@am__fastdepCC_FALSE@@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @@AMDEPBACKSLASH@@ @@am__fastdepCC_FALSE@@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvarnishcompat_la_CFLAGS) $(CFLAGS) -c -o libvarnishcompat_la-setproctitle.lo `test -f 'setproctitle.c' || echo '$(srcdir)/'`setproctitle.c +libvarnishcompat_la-daemon.lo: daemon.c +@@am__fastdepCC_TRUE@@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvarnishcompat_la_CFLAGS) $(CFLAGS) -MT libvarnishcompat_la-daemon.lo -MD -MP -MF $(DEPDIR)/libvarnishcompat_la-daemon.Tpo -c -o libvarnishcompat_la-daemon.lo `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c +@@am__fastdepCC_TRUE@@ mv -f $(DEPDIR)/libvarnishcompat_la-daemon.Tpo $(DEPDIR)/libvarnishcompat_la-daemon.Plo +@@AMDEP_TRUE@@@@am__fastdepCC_FALSE@@ source='daemon.c' object='libvarnishcompat_la-daemon.lo' libtool=yes @@AMDEPBACKSLASH@@ +@@AMDEP_TRUE@@@@am__fastdepCC_FALSE@@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @@AMDEPBACKSLASH@@ +@@am__fastdepCC_FALSE@@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvarnishcompat_la_CFLAGS) $(CFLAGS) -c -o libvarnishcompat_la-daemon.lo `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c + libvarnishcompat_la-srandomdev.lo: srandomdev.c @@am__fastdepCC_TRUE@@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvarnishcompat_la_CFLAGS) $(CFLAGS) -MT libvarnishcompat_la-srandomdev.lo -MD -MP -MF $(DEPDIR)/libvarnishcompat_la-srandomdev.Tpo -c -o libvarnishcompat_la-srandomdev.lo `test -f 'srandomdev.c' || echo '$(srcdir)/'`srandomdev.c @@am__fastdepCC_TRUE@@ mv -f $(DEPDIR)/libvarnishcompat_la-srandomdev.Tpo $(DEPDIR)/libvarnishcompat_la-srandomdev.Plo Index: lib/libvarnishcompat/daemon.c --- /dev/null 2007-10-06 10:39:16 +0200 +++ lib/libvarnishcompat/daemon.c 2007-10-06 10:39:12 +0200 @@@@ -0,0 +1,112 @@@@ +/* +** proc_daemon.c -- daemonize current process +** Copyright (c) 1999-2006 Ralf S. Engelschall +** +** See "Unix Programming Frequently Asked Questions": +** http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC10 +*/ + +#if !defined(HAVE_DAEMON) + +#include +#include +#include +#include +#include +#include + +#include "compat/daemon.h" + +int daemon(int nochdir, int noclose) +{ + int fd; + int rc; + +#if 0 + /* if we are started from init, no need to become daemon. */ + if (getppid() == 1) + return; +#endif + + /* ignore tty related signals */ +#ifdef SIGTTOU + signal(SIGTTOU, SIG_IGN); +#endif +#ifdef SIGTTIN + signal(SIGTTIN, SIG_IGN); +#endif +#ifdef SIGTSTP + signal(SIGTSTP, SIG_IGN); +#endif + + /* fork so the parent can exit, this returns control to the command line + or shell invoking your program. This step is required so that the new + process is guaranteed not to be a process group leader (The next step, + setsid, would fail if you're a process group leader). */ + rc = fork(); + switch (rc) { + case -1: return -1; + case 0: break; + default: _exit(0); /* exit original process */ + } + + /* setsid to become a process group and session group leader. Since a + controlling terminal is associated with a session, and this new session + has not yet acquired a controlling terminal our process now has no + controlling terminal, which is a Good Thing for daemons. */ +#if defined(HAVE_SETSID) || defined(__sun__) + if (setsid() == -1) + return -1; +#else + if (setpgid(0, getpid()) == -1) + return -1; +#if defined(TIOCNOTTY) +#ifndef _PATH_TTY +#define _PATH_TTY "/dev/tty" +#endif + if ((fd = open(_PATH_TTY, O_RDWR)) == -1) + return -1; + ioctl(fd, TIOCNOTTY, NULL); + close(fd); +#endif +#endif + + /* fork again so the parent (the session group leader) can exit. This + means that we, as a non-session group leader, can never regain a + controlling terminal. */ + rc = fork(); + switch (rc) { + case -1: return -1; + case 0: break; + default: _exit(0); /* exit original process */ + } + + /* change to root directory ensure that our process doesn't keep + any directory in use. Failure to do this could make it so that + an administrator couldn't unmount a filesystem, because it was + our current directory. [Equivalently, we could change to any + directory containing files important to the daemon's operation.] */ + if (!nochdir) + chdir("/"); + + /* give us complete control over the permissions of anything we + write. We don't know what umask we may have inherited. + [This step is optional] */ + umask(0); + + /* close fds 0, 1, and 2. This releases the standard in, out, and + error we inherited from our parent process. We have no way of + knowing where these fds might have been redirected to. */ + if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { + dup2(fd, STDIN_FILENO); + dup2(fd, STDOUT_FILENO); + dup2(fd, STDERR_FILENO); + if (fd > 2) + close(fd); + } + + return 0; +} + +#endif + @ 1.4 log @upgrading package: varnish 1.1 -> 1.1.1 @ text @d1 12 d14 3 a16 3 --- bin/varnishd/mgt_child.c.orig 2006-09-20 19:18:51 +0200 +++ bin/varnishd/mgt_child.c 2006-10-11 22:42:04 +0200 @@@@ -172,6 +172,21 @@@@ d18 1 a18 1 fprintf(stderr, "start child pid %d\n", i); d38 3 a40 3 Index: bin/varnishd/mgt_vcc.c 2007-07-20 16:43:35 +0200 --- bin/varnishd/mgt_vcc.c.orig 2007-07-20 13:30:04 +0200 +++ bin/varnishd/mgt_vcc.c 2007-07-20 16:43:35 +0200 d50 184 @ 1.3 log @upgrading package: varnish 1.0.4 -> 1.1 @ text @a37 45 Index: bin/varnishhist/varnishhist.c --- bin/varnishhist/varnishhist.c.orig 2007-07-20 13:30:04 +0200 +++ bin/varnishhist/varnishhist.c 2007-07-20 16:16:26 +0200 @@@@ -41,6 +41,7 @@@@ #include #include #include +#include #include #include Index: bin/varnishstat/varnishstat.c --- bin/varnishstat/varnishstat.c 2007-07-20 13:30:04 +0200 +++ bin/varnishstat/varnishstat.c 2007-07-20 16:18:58 +0200 @@@@ -40,6 +40,7 @@@@ #include #include #include +#include #include #include #include Index: bin/varnishtop/varnishtop.c --- bin/varnishtop/varnishtop.c.orig 2007-07-20 13:30:04 +0200 +++ bin/varnishtop/varnishtop.c 2007-07-20 16:22:58 +0200 @@@@ -39,6 +39,7 @@@@ #include #include #include +#include #include #include #include Index: Makefile --- Makefile.in.orig 2007-07-20 13:33:02 +0200 +++ Makefile.in 2007-07-20 16:37:05 +0200 @@@@ -670,7 +670,7 @@@@ install-data-local: - $(install_sh) -d -m 0755 $(localstatedir)/varnish + $(install_sh) -d -m 0755 $(DESTDIR)$(localstatedir)/varnish # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: @ 1.2 log @- bugfix: exit(1) in case the PID file is not writable or a segfault would happen by the following fprintf/fclose. - cleanup: do not keep the C library files in the package as they are both useless without the corresponding C header files and even with them they are not really useful as varnish is a self-contained application. - consistency: use "switch" instead of "osdn" for SourceForge URLs to be in sync with all(!) other packages (although we know that the host "osdn" is available again). - cosmetics: use our usual 'all-caps' style in Summary header - cosmetics: use 0-prefix patch to avoid hard-coded versions in patch files when easily possible @ text @d26 57 @ 1.2.2.1 log @file varnish.patch was added on branch OPENPKG_2_STABLE on 2006-10-16 14:57:43 +0000 @ text @d1 25 @ 1.2.2.2 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @a0 25 Index: bin/varnishd/mgt_child.c --- bin/varnishd/mgt_child.c.orig 2006-09-20 19:18:51 +0200 +++ bin/varnishd/mgt_child.c 2006-10-11 22:42:04 +0200 @@@@ -172,6 +172,21 @@@@ fprintf(stderr, "start child pid %d\n", i); +#ifdef OPKG_PIDFILE + { + pid_t pid; + FILE *fp; + + pid = getpid(); + if ((fp = fopen(OPKG_PIDFILE, "w")) == NULL) { + fprintf(stderr, "varnishd:ERROR: cannot write PID file '%s'\n", OPKG_PIDFILE); + exit(1); + } + fprintf(fp, "%ld\n", (long)pid); + fclose(fp); + } +#endif + AZ(close(child_fds[1])); child_fds[1] = -1; @ 1.1 log @new package: varnish 1.0.1 (High-performance HTTP accelerator) @ text @d1 4 a4 3 --- varnish-1.0.1.orig/bin/varnishd/mgt_child.c Wed Sep 20 19:18:51 2006 +++ varnish-1.0.1/bin/varnishd/mgt_child.c Wed Oct 11 15:29:18 2006 @@@@ -172,6 +172,24 @@@@ a8 3 + /* + * create PID file + */ d15 2 a16 2 + fprintf(stderr, "can't write PID file '%s'", + OPKG_PIDFILE); @