Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mike Perry
Tor
Commits
b40d0bff
Commit
b40d0bff
authored
Oct 20, 2003
by
Roger Dingledine
Browse files
a skeletal print_usage() function
svn:r634
parent
db33eac4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/or/config.c
View file @
b40d0bff
...
...
@@ -191,6 +191,10 @@ static void config_assign(or_options_t *options, struct config_line *list) {
}
}
void
print_usage
(
void
)
{
}
/* return 0 if success, <0 if failure. */
int
getconfig
(
int
argc
,
char
**
argv
,
or_options_t
*
options
)
{
struct
config_line
*
cl
;
...
...
@@ -215,6 +219,11 @@ int getconfig(int argc, char **argv, or_options_t *options) {
options
->
TotalBandwidth
=
800000
;
/* at most 800kB/s total sustained incoming */
options
->
NumCpus
=
1
;
if
(
argc
>
1
&&
(
!
strcmp
(
argv
[
1
],
"-h"
)
||
!
strcmp
(
argv
[
1
],
"--help"
)))
{
print_usage
();
exit
(
0
);
}
/* learn config file name, get config lines, assign them */
i
=
1
;
while
(
i
<
argc
-
1
&&
strcmp
(
argv
[
i
],
"-f"
))
{
...
...
src/or/main.c
View file @
b40d0bff
...
...
@@ -784,7 +784,7 @@ int tor_main(int argc, char *argv[]) {
add_stream_log
(
LOG_INFO
,
"<stdout>"
,
stdout
);
if
(
getconfig
(
argc
,
argv
,
&
options
))
{
log_fn
(
LOG_ERR
,
"Reading config
file
failed.
exiting
."
);
log_fn
(
LOG_ERR
,
"Reading config failed.
For usage, try -h
."
);
return
-
1
;
}
log_set_severity
(
options
.
loglevel
);
/* assign logging severity level from options */
...
...
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