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
918cd814
Commit
918cd814
authored
Nov 16, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't start a subprocess just to kill our own child process.
parent
24870927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
vtc_process.c
bin/varnishtest/vtc_process.c
+14
-8
No files found.
bin/varnishtest/vtc_process.c
View file @
918cd814
...
...
@@ -247,8 +247,7 @@ process_run(struct process *p)
static
void
process_kill
(
const
struct
process
*
p
,
const
char
*
sig
)
{
int
s
;
char
buf
[
64
];
int
j
;
CHECK_OBJ_NOTNULL
(
p
,
PROCESS_MAGIC
);
AN
(
sig
);
...
...
@@ -256,12 +255,19 @@ process_kill(const struct process *p, const char *sig)
if
(
!
p
->
running
||
!
p
->
pid
)
vtc_log
(
p
->
vl
,
0
,
"Cannot signal a non-running process"
);
bprintf
(
buf
,
"kill -%s -%d"
,
sig
,
p
->
pid
);
vtc_log
(
p
->
vl
,
4
,
"CMD: %s"
,
buf
);
s
=
system
(
buf
);
if
(
s
!=
0
)
vtc_log
(
p
->
vl
,
0
,
"Failed to send signal (exit status: %d)"
,
s
);
if
(
!
strcmp
(
sig
,
"TERM"
))
j
=
SIGTERM
;
else
if
(
!
strcmp
(
sig
,
"HUP"
))
j
=
SIGHUP
;
else
if
(
!
strcmp
(
sig
,
"KILL"
))
j
=
SIGKILL
;
else
j
=
strtoul
(
sig
,
NULL
,
10
);
if
(
kill
(
p
->
pid
,
j
)
<
0
)
vtc_log
(
p
->
vl
,
0
,
"Failed to send signal %d (%s)"
,
j
,
strerror
(
errno
));
else
vtc_log
(
p
->
vl
,
4
,
"Sent signal %d"
,
j
);
}
static
inline
void
...
...
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