Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
1a7b6c03
Commit
1a7b6c03
authored
Jul 10, 2012
by
Niels Möller
Browse files
Send usage message to stderr, rather than stdout, on errors.
parent
90b82481
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
1a7b6c03
2012-07-10 Niels Möller <nisse@lysator.liu.se>
* src/testsuite/mini-inetd.c (usage): Take a FILE * as argument.
Called with stdout in response to --help, and stderr otherwise.
* src/testsuite/prgrp-timeout.c: Added missing include of
config.h.
...
...
src/testsuite/mini-inetd.c
View file @
1a7b6c03
...
...
@@ -63,13 +63,19 @@ werror(const char *format, ...)
}
static
void
usage
(
void
)
usage
(
FILE
*
f
)
{
printf
(
"mini-inetd [OPTIONS] [localaddr:]port program [argv0, argv1 ...]
\n
"
"Options:
\n
"
" -m max-connections
\n
"
" --help
\n
"
" --background
\n
"
);
fprintf
(
f
,
/* FIXME: ':' is a bad separator for literal IPv6 addresses.
Support [] around the address? */
"mini-inetd [OPTIONS] [localaddr:]port program [argv0, argv1 ...]
\n
"
"Options:
\n
"
" -m max-connections
\n
"
" --help
\n
"
" --background
\n
"
" -4 Only use IPv4.
\n
"
" -6 Only use IPv6.
\n
"
" --help Display this help.
\n
"
);
}
static
void
...
...
@@ -133,7 +139,7 @@ main (int argc, char **argv)
case
'?'
:
return
EXIT_FAILURE
;
case
OPT_HELP
:
usage
();
usage
(
stdout
);
return
EXIT_SUCCESS
;
case
OPT_BACKGROUND
:
background
=
1
;
...
...
@@ -164,7 +170,7 @@ main (int argc, char **argv)
if
(
argc
<
2
)
{
usage
();
usage
(
stderr
);
return
EXIT_FAILURE
;
}
sep
=
strrchr
(
argv
[
0
],
':'
);
...
...
Write
Preview
Supports
Markdown
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