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
061ba991
Commit
061ba991
authored
Jan 20, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using vnotify() for die()
parent
ead098f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
server.c
examples/server.c
+11
-6
No files found.
examples/server.c
View file @
061ba991
...
...
@@ -97,17 +97,22 @@ static void __cdecl signal_handler(int sig_num) {
{
exit_flag
=
sig_num
;
}
}
static
void
die
(
const
char
*
fmt
,
...)
{
va_list
ap
;
static
void
vnotify
(
const
char
*
fmt
,
va_list
ap
,
int
must_exit
)
{
char
msg
[
200
];
va_start
(
ap
,
fmt
);
vsnprintf
(
msg
,
sizeof
(
msg
),
fmt
,
ap
);
va_end
(
ap
);
fprintf
(
stderr
,
"%s
\n
"
,
msg
);
exit
(
EXIT_FAILURE
);
if
(
must_exit
)
{
exit
(
EXIT_FAILURE
);
}
}
static
void
die
(
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
vnotify
(
fmt
,
ap
,
1
);
va_end
(
ap
);
}
static
void
show_usage_and_exit
(
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