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
cf17fc16
Commit
cf17fc16
authored
Jan 07, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close std{in|out|err} before invoking Eric.
parent
48f1cbac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
6 deletions
+31
-6
mgt_main.c
bin/varnishd/mgt/mgt_main.c
+31
-6
No files found.
bin/varnishd/mgt/mgt_main.c
View file @
cf17fc16
...
@@ -575,6 +575,36 @@ mgt_eric(void)
...
@@ -575,6 +575,36 @@ mgt_eric(void)
exit
(
-
1
);
exit
(
-
1
);
}
}
static
void
mgt_eric_im_done
(
int
eric_fd
,
unsigned
u
)
{
int
fd
;
if
(
eric_fd
<
0
)
return
;
if
(
u
==
0
)
u
=
ERIC_MAGIC
;
fd
=
open
(
"/dev/null"
,
O_RDONLY
);
assert
(
fd
>=
0
);
assert
(
dup2
(
fd
,
STDIN_FILENO
)
==
STDIN_FILENO
);
AZ
(
close
(
fd
));
fd
=
open
(
"/dev/null"
,
O_WRONLY
);
assert
(
fd
>=
0
);
assert
(
dup2
(
fd
,
STDOUT_FILENO
)
==
STDOUT_FILENO
);
AZ
(
close
(
fd
));
fd
=
open
(
"/dev/null"
,
O_WRONLY
);
assert
(
fd
>=
0
);
assert
(
dup2
(
fd
,
STDERR_FILENO
)
==
STDERR_FILENO
);
AZ
(
close
(
fd
));
assert
(
write
(
eric_fd
,
&
u
,
sizeof
u
)
==
sizeof
u
);
AZ
(
close
(
eric_fd
));
}
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
int
int
...
@@ -906,12 +936,7 @@ main(int argc, char * const *argv)
...
@@ -906,12 +936,7 @@ main(int argc, char * const *argv)
u
=
MGT_Run
();
u
=
MGT_Run
();
if
(
eric_fd
>
0
)
{
mgt_eric_im_done
(
eric_fd
,
u
);
if
(
u
==
0
)
u
=
ERIC_MAGIC
;
assert
(
write
(
eric_fd
,
&
u
,
sizeof
u
)
==
sizeof
u
);
AZ
(
close
(
eric_fd
));
}
o
=
vev_schedule
(
mgt_evb
);
o
=
vev_schedule
(
mgt_evb
);
if
(
o
!=
0
)
if
(
o
!=
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