Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
85bc696c
Commit
85bc696c
authored
Oct 16, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add error handling for strdup and sigaction
parent
54bf2256
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
src/shrpx.cc
src/shrpx.cc
+5
-0
src/shrpx_signal.cc
src/shrpx_signal.cc
+7
-1
No files found.
src/shrpx.cc
View file @
85bc696c
...
...
@@ -1682,6 +1682,11 @@ int main(int argc, char **argv) {
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
mod_config
()
->
argv
[
i
]
=
strdup
(
argv
[
i
]);
if
(
mod_config
()
->
argv
[
i
]
==
nullptr
)
{
auto
error
=
errno
;
LOG
(
FATAL
)
<<
"failed to copy argv: "
<<
strerror
(
error
);
exit
(
EXIT_FAILURE
);
}
}
mod_config
()
->
cwd
=
getcwd
(
nullptr
,
0
);
...
...
src/shrpx_signal.cc
View file @
85bc696c
...
...
@@ -97,8 +97,14 @@ void signal_set_handler(void (*handler)(int), Signals &&sigs) {
struct
sigaction
act
{};
act
.
sa_handler
=
handler
;
sigemptyset
(
&
act
.
sa_mask
);
int
rv
;
for
(
auto
sig
:
sigs
)
{
sigaction
(
sig
,
&
act
,
nullptr
);
rv
=
sigaction
(
sig
,
&
act
,
nullptr
);
if
(
rv
!=
0
)
{
auto
error
=
errno
;
LOG
(
WARN
)
<<
"sigaction() with signal "
<<
sig
<<
" failed: errno="
<<
error
;
}
}
}
}
// namespace
...
...
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