Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mongoose
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
Ganil-acq
GANILinux
linux-service
library
mongoose
Commits
061ba991
Commit
061ba991
authored
11 years ago
by
Sergey Lyubka
Browse files
Options
Downloads
Patches
Plain Diff
Using vnotify() for die()
parent
ead098f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/server.c
+11
-6
11 additions, 6 deletions
examples/server.c
with
11 additions
and
6 deletions
examples/server.c
+
11
−
6
View file @
061ba991
...
@@ -97,17 +97,22 @@ static void __cdecl signal_handler(int sig_num) {
...
@@ -97,17 +97,22 @@ static void __cdecl signal_handler(int sig_num) {
{
exit_flag
=
sig_num
;
}
{
exit_flag
=
sig_num
;
}
}
}
static
void
die
(
const
char
*
fmt
,
...)
{
static
void
vnotify
(
const
char
*
fmt
,
va_list
ap
,
int
must_exit
)
{
va_list
ap
;
char
msg
[
200
];
char
msg
[
200
];
va_start
(
ap
,
fmt
);
vsnprintf
(
msg
,
sizeof
(
msg
),
fmt
,
ap
);
vsnprintf
(
msg
,
sizeof
(
msg
),
fmt
,
ap
);
va_end
(
ap
);
fprintf
(
stderr
,
"%s
\n
"
,
msg
);
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
)
{
static
void
show_usage_and_exit
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment