Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
227a3944
Commit
227a3944
authored
May 02, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a dummy pipe to use for poll(2)'ing the death of varnishd,
while we wait for it to establish CLI connection.
parent
1eac7c26
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+11
-5
No files found.
bin/varnishtest/vtc_varnish.c
View file @
227a3944
...
...
@@ -59,7 +59,7 @@ struct varnish {
struct
vsb
*
storage
;
struct
vsb
*
args
;
int
fds
[
4
];
int
fds
[
6
];
pid_t
pid
;
pthread_t
tp
;
...
...
@@ -365,6 +365,7 @@ varnish_launch(struct varnish *v)
vtc_log
(
v
->
vl
,
3
,
"CMD: %s"
,
VSB_data
(
vsb
));
AZ
(
pipe
(
&
v
->
fds
[
0
]));
AZ
(
pipe
(
&
v
->
fds
[
2
]));
AZ
(
pipe
(
&
v
->
fds
[
4
]));
v
->
pid
=
fork
();
assert
(
v
->
pid
>=
0
);
if
(
v
->
pid
==
0
)
{
...
...
@@ -375,8 +376,11 @@ varnish_launch(struct varnish *v)
AZ
(
close
(
v
->
fds
[
1
]));
AZ
(
close
(
v
->
fds
[
2
]));
AZ
(
close
(
v
->
fds
[
3
]));
for
(
i
=
3
;
i
<
getdtablesize
();
i
++
)
AZ
(
close
(
v
->
fds
[
4
]));
for
(
i
=
3
;
i
<
getdtablesize
();
i
++
)
{
if
(
v
->
fds
[
5
]
!=
i
)
(
void
)
close
(
i
);
}
AZ
(
execl
(
"/bin/sh"
,
"/bin/sh"
,
"-c"
,
VSB_data
(
vsb
),
NULL
));
exit
(
1
);
}
else
{
...
...
@@ -384,6 +388,7 @@ varnish_launch(struct varnish *v)
}
AZ
(
close
(
v
->
fds
[
0
]));
AZ
(
close
(
v
->
fds
[
3
]));
AZ
(
close
(
v
->
fds
[
5
]));
v
->
fds
[
0
]
=
v
->
fds
[
2
];
v
->
fds
[
2
]
=
v
->
fds
[
3
]
=
-
1
;
VSB_delete
(
vsb
);
...
...
@@ -394,8 +399,8 @@ varnish_launch(struct varnish *v)
memset
(
fd
,
0
,
sizeof
fd
);
fd
[
0
].
fd
=
v
->
cli_fd
;
fd
[
0
].
events
=
POLLIN
;
fd
[
1
].
fd
=
v
->
fds
[
0
];
fd
[
1
].
events
=
POLLHUP
;
fd
[
1
].
fd
=
v
->
fds
[
4
];
fd
[
1
].
events
=
POLL
IN
|
POLL
HUP
;
#ifdef __APPLE__
/*
* OSX cannot poll a pipe for POLLHUP only, poll just returns
...
...
@@ -425,6 +430,7 @@ varnish_launch(struct varnish *v)
return
;
}
AZ
(
close
(
v
->
fds
[
4
]));
AZ
(
close
(
v
->
cli_fd
));
v
->
cli_fd
=
nfd
;
...
...
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