Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
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
esp
mongoose
Commits
73d2b395
Commit
73d2b395
authored
Sep 07, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved SIGCHLD handler out of mongoose.c. Embedded user must set SIGCHLD handler if CGI is used.
parent
e556a487
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
main.c
build/main.c
+5
-0
mongoose.c
mongoose.c
+0
-2
mongoose.h
mongoose.h
+4
-2
No files found.
build/main.c
View file @
73d2b395
...
...
@@ -375,6 +375,11 @@ static void start_mongoose(int argc, char *argv[]) {
signal
(
SIGTERM
,
signal_handler
);
signal
(
SIGINT
,
signal_handler
);
#if !defined(_WIN32)
// Also ignoring SIGCHLD to let the OS to reap zombies properly.
(
void
)
signal
(
SIGCHLD
,
SIG_IGN
);
#endif
// Start Mongoose
memset
(
&
callbacks
,
0
,
sizeof
(
callbacks
));
callbacks
.
log_message
=
&
log_message
;
...
...
mongoose.c
View file @
73d2b395
...
...
@@ -5452,8 +5452,6 @@ struct mg_context *mg_start(const struct mg_callbacks *callbacks,
// Ignore SIGPIPE signal, so if browser cancels the request, it
// won't kill the whole process.
(
void
)
signal
(
SIGPIPE
,
SIG_IGN
);
// Also ignoring SIGCHLD to let the OS to reap zombies properly.
(
void
)
signal
(
SIGCHLD
,
SIG_IGN
);
#endif // !_WIN32
(
void
)
pthread_mutex_init
(
&
ctx
->
mutex
,
NULL
);
...
...
mongoose.h
View file @
73d2b395
...
...
@@ -142,10 +142,12 @@ struct mg_callbacks {
// options: NULL terminated list of option_name, option_value pairs that
// specify Mongoose configuration parameters.
//
// Side-effects: on UNIX, ignores SIG
CHLD and SIG
PIPE signals. If custom
// processing is required
for these, signal handlers
must be set up
// Side-effects: on UNIX, ignores SIGPIPE signals. If custom
// processing is required
SIGPIPE, signal handler
must be set up
// after calling mg_start().
//
// Important: Mongoose does not install SIGCHLD handler. If CGI is used,
// SIGCHLD handler must be set up to reap CGI zombie processes.
//
// Example:
// const char *options[] = {
...
...
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