Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
d9c3cdda
Commit
d9c3cdda
authored
Jan 21, 2017
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build when daemon() is not available
parent
60f868e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
daemon.c
lib/libvarnishapi/daemon.c
+21
-4
No files found.
lib/libvarnishapi/daemon.c
View file @
d9c3cdda
...
...
@@ -39,7 +39,24 @@
#include <unistd.h>
#include "compat/daemon.h"
#include "vfil.h"
#include "vas.h"
/*
* Copied from libvarnish/vfil.c to avoid pulling libvarnish or vfil.c
* directly when daemon() is not working/available (i.e. OSX).
*
*/
static
void
vfil_null_fd
(
int
target
)
{
int
fd
;
assert
(
target
>=
0
);
fd
=
open
(
"/dev/null"
,
O_RDWR
);
assert
(
fd
>=
0
);
assert
(
dup2
(
fd
,
target
)
==
target
);
AZ
(
close
(
fd
));
}
int
varnish_daemon
(
int
nochdir
,
int
noclose
)
...
...
@@ -82,9 +99,9 @@ varnish_daemon(int nochdir, int noclose)
(
void
)
chdir
(
"/"
);
if
(
!
noclose
)
{
VFIL
_null_fd
(
STDIN_FILENO
);
VFIL
_null_fd
(
STDOUT_FILENO
);
VFIL
_null_fd
(
STDERR_FILENO
);
vfil
_null_fd
(
STDIN_FILENO
);
vfil
_null_fd
(
STDOUT_FILENO
);
vfil
_null_fd
(
STDERR_FILENO
);
}
return
(
0
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment