Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdfp-pipe
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
libvdfp-pipe
Commits
c4f7869a
Commit
c4f7869a
authored
Aug 10, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print error messages from the forked process to stderr.
parent
d0b4a24c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
vdfp_pipe.c
src/vdfp_pipe.c
+8
-9
No files found.
src/vdfp_pipe.c
View file @
c4f7869a
...
...
@@ -34,6 +34,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <limits.h>
...
...
@@ -140,12 +141,11 @@ mk_pipe(int fds[2], char *name, struct vsl_log *vsl)
}
static
inline
int
mk_dup
(
int
oldfd
,
int
newfd
,
char
*
name
,
struct
vsl_log
*
vsl
)
mk_dup
(
int
oldfd
,
int
newfd
)
{
errno
=
0
;
if
(
dup2
(
oldfd
,
newfd
)
==
-
1
)
{
VSLb
(
vsl
,
SLT_Error
,
"vdfp_pipe: vdp %s: dup2(2) failed: %s"
,
name
,
vstrerror
(
errno
));
fprintf
(
stderr
,
"dup2(2) failed: %s"
,
vstrerror
(
errno
));
return
(
-
1
);
}
return
(
0
);
...
...
@@ -239,18 +239,17 @@ vdp_init(struct req *req, void **priv)
closefd
(
&
in
[
1
]);
closefd
(
&
out
[
0
]);
closefd
(
&
err
[
0
]);
if
(
mk_dup
(
in
[
0
],
STDIN_FILENO
,
obj
->
name
,
req
->
vsl
)
!=
0
)
if
(
mk_dup
(
err
[
1
],
STDERR_FILENO
)
!=
0
)
exit
(
EXIT_FAILURE
);
if
(
mk_dup
(
out
[
1
],
STDOUT_FILENO
,
obj
->
name
,
req
->
vsl
)
!=
0
)
if
(
mk_dup
(
in
[
0
],
STDIN_FILENO
)
!=
0
)
exit
(
EXIT_FAILURE
);
if
(
mk_dup
(
err
[
1
],
STDERR_FILENO
,
obj
->
name
,
req
->
vsl
)
!=
0
)
if
(
mk_dup
(
out
[
1
],
STDOUT_FILENO
)
!=
0
)
exit
(
EXIT_FAILURE
);
errno
=
0
;
if
(
execve
(
obj
->
path
,
argv
,
environ
)
==
-
1
)
{
VSLb
(
req
->
vsl
,
SLT_Error
,
"vdfp_pipe: vdp %s: cannot "
"exec %s: %s"
,
obj
->
name
,
obj
->
path
,
vstrerror
(
errno
));
fprintf
(
stderr
,
"cannot exec %s: %s"
,
obj
->
path
,
vstrerror
(
errno
));
exit
(
EXIT_FAILURE
);
}
}
...
...
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