mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-12 15:17:14 +03:00
Ignore opts (#436)
* Be less strict about args at startup Ignore unknown options. * Don't fail if pid file is accessible
This commit is contained in:
parent
fee8491a8e
commit
b3c770898a
12
common.c
12
common.c
@ -853,19 +853,19 @@ void write_pid_file(const char* pidfile)
|
||||
|
||||
f = fopen(pidfile, "w");
|
||||
if (!f) {
|
||||
print_message(msg_system_error, "write_pid_file:%s:%s", pidfile, strerror(errno));
|
||||
exit(3);
|
||||
print_message(msg_system_error, "write_pid_file: %s: %s\n", pidfile, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
res = fprintf(f, "%d\n", getpid());
|
||||
if (res < 0) {
|
||||
print_message(msg_system_error, "write_pid_file:fprintf:%s", strerror(errno));
|
||||
exit(3);
|
||||
print_message(msg_system_error, "write_pid_file: fprintf: %s\n", strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
res = fclose(f);
|
||||
if (res == EOF) {
|
||||
print_message(msg_system_error, "write_pid_file:fclose:%s", strerror(errno));
|
||||
exit(3);
|
||||
print_message(msg_system_error, "write_pid_file: fclose: %s\n", strerror(errno));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2239,10 +2239,13 @@ int sslhcfg_cl_parse(int argc, char* argv[], struct sslhcfg_item* cfg)
|
||||
/* Parse command line */
|
||||
nerrors = arg_parse(argc, argv, argtable);
|
||||
if (nerrors) {
|
||||
arg_print_errors(stdout, sslhcfg_end, "sslhcfg");
|
||||
// print bad args
|
||||
arg_print_errors(stdout, sslhcfg_end, "sslhcfg");
|
||||
// print usage
|
||||
arg_print_syntax(stdout, argtable, "\n");
|
||||
// print options
|
||||
arg_print_glossary(stdout, argtable, " %-25s\t%s\n");
|
||||
return -1;
|
||||
fprintf(stderr, "Invalid args are ignored, please fix them\n");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user