Commit bb0fee00 authored by Artur Bergman's avatar Artur Bergman

make -werror work on OSX again .. check for daemon only if it isn't OSX as...

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

git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4112 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 3885a6d0
......@@ -50,9 +50,7 @@ SVNID("$Id$")
#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 @@ main(int argc, char * const *argv)
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());
......
......@@ -44,9 +44,7 @@ SVNID("$Id$")
#include <unistd.h>
#include <limits.h>
#ifndef HAVE_DAEMON
#include "compat/daemon.h"
#endif
#include "vsb.h"
#include "vpf.h"
......@@ -373,7 +371,7 @@ main(int argc, char **argv)
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);
......
......@@ -72,9 +72,7 @@ SVNID("$Id$")
#include <unistd.h>
#include <limits.h>
#ifndef HAVE_DAEMON
#include "compat/daemon.h"
#endif
#include "vsb.h"
#include "vpf.h"
......@@ -570,7 +568,7 @@ main(int argc, char *argv[])
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);
......
......@@ -177,7 +177,6 @@ AC_CHECK_FUNCS([setproctitle])
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 @@ case $target in
ac_cv_func_daemon=no
;;
*)
AC_MSG_RESULT([yes])
AC_CHECK_FUNCS([daemon])
;;
esac
......
......@@ -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
......@@ -45,7 +45,7 @@ SVNID("$Id$")
#include "compat/daemon.h"
int
daemon(int nochdir, int noclose)
varnish_daemon(int nochdir, int noclose)
{
struct sigaction osa, sa;
int fd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment