r4112 - in trunk/varnish-cache: . bin/varnishd bin/varnishlog bin/varnishncsa include/compat lib/libvarnishcompat
sky at projects.linpro.no
sky at projects.linpro.no
Wed Jun 17 15:16:46 CEST 2009
Author: sky
Date: 2009-06-17 15:16:45 +0200 (Wed, 17 Jun 2009)
New Revision: 4112
Modified:
trunk/varnish-cache/bin/varnishd/varnishd.c
trunk/varnish-cache/bin/varnishlog/varnishlog.c
trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
trunk/varnish-cache/configure.ac
trunk/varnish-cache/include/compat/daemon.h
trunk/varnish-cache/lib/libvarnishcompat/daemon.c
Log:
make -werror work on OSX again .. check for daemon only if it isn't OSX as well as rename the function to varnish_daemon not to clash with the OSX daemon definition, tested on linux and osx
Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c 2009-06-17 12:36:20 UTC (rev 4111)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c 2009-06-17 13:16:45 UTC (rev 4112)
@@ -50,9 +50,7 @@
#include <time.h>
#include <unistd.h>
-#ifndef HAVE_DAEMON
#include "compat/daemon.h"
-#endif
#ifndef HAVE_STRLCPY
#include "compat/strlcpy.h"
@@ -716,7 +714,7 @@
if (d_flag == 1)
DebugStunt();
if (d_flag < 2 && !F_flag)
- AZ(daemon(1, d_flag));
+ AZ(varnish_daemon(1, d_flag));
if (d_flag == 1)
printf("%d\n", getpid());
Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishlog/varnishlog.c 2009-06-17 12:36:20 UTC (rev 4111)
+++ trunk/varnish-cache/bin/varnishlog/varnishlog.c 2009-06-17 13:16:45 UTC (rev 4112)
@@ -44,9 +44,7 @@
#include <unistd.h>
#include <limits.h>
-#ifndef HAVE_DAEMON
#include "compat/daemon.h"
-#endif
#include "vsb.h"
#include "vpf.h"
@@ -373,7 +371,7 @@
exit(1);
}
- if (D_flag && daemon(0, 0) == -1) {
+ if (D_flag && varnish_daemon(0, 0) == -1) {
perror("daemon()");
if (pfh != NULL)
vpf_remove(pfh);
Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
===================================================================
--- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2009-06-17 12:36:20 UTC (rev 4111)
+++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2009-06-17 13:16:45 UTC (rev 4112)
@@ -72,9 +72,7 @@
#include <unistd.h>
#include <limits.h>
-#ifndef HAVE_DAEMON
#include "compat/daemon.h"
-#endif
#include "vsb.h"
#include "vpf.h"
@@ -570,7 +568,7 @@
exit(1);
}
- if (D_flag && daemon(0, 0) == -1) {
+ if (D_flag && varnish_daemon(0, 0) == -1) {
perror("daemon()");
if (pfh != NULL)
vpf_remove(pfh);
Modified: trunk/varnish-cache/configure.ac
===================================================================
--- trunk/varnish-cache/configure.ac 2009-06-17 12:36:20 UTC (rev 4111)
+++ trunk/varnish-cache/configure.ac 2009-06-17 13:16:45 UTC (rev 4112)
@@ -177,7 +177,6 @@
AC_CHECK_FUNCS([srandomdev])
AC_CHECK_FUNCS([strlcat strlcpy])
AC_CHECK_FUNCS([strndup])
-AC_CHECK_FUNCS([daemon])
# white lie - we don't actually test it
AC_MSG_CHECKING([whether daemon() works])
case $target in
@@ -187,7 +186,7 @@
ac_cv_func_daemon=no
;;
*)
- AC_MSG_RESULT([yes])
+ AC_CHECK_FUNCS([daemon])
;;
esac
Modified: trunk/varnish-cache/include/compat/daemon.h
===================================================================
--- trunk/varnish-cache/include/compat/daemon.h 2009-06-17 12:36:20 UTC (rev 4111)
+++ trunk/varnish-cache/include/compat/daemon.h 2009-06-17 13:16:45 UTC (rev 4112)
@@ -33,7 +33,9 @@
#define COMPAT_DAEMON_H_INCLUDED
#ifndef HAVE_DAEMON
-int daemon(int nochdir, int noclose);
+int varnish_daemon(int nochdir, int noclose);
+#else
+#define varnish_daemon(a,b) daemon(a,b)
#endif
#endif
Modified: trunk/varnish-cache/lib/libvarnishcompat/daemon.c
===================================================================
--- trunk/varnish-cache/lib/libvarnishcompat/daemon.c 2009-06-17 12:36:20 UTC (rev 4111)
+++ trunk/varnish-cache/lib/libvarnishcompat/daemon.c 2009-06-17 13:16:45 UTC (rev 4112)
@@ -45,7 +45,7 @@
#include "compat/daemon.h"
int
-daemon(int nochdir, int noclose)
+varnish_daemon(int nochdir, int noclose)
{
struct sigaction osa, sa;
int fd;
More information about the varnish-commit
mailing list