break;
case 'r':
server->reconnect = atoi(optarg);
- if (server->reconnect <= 0) {
+ if (server->reconnect < 0) {
fprintf(stderr, "ttyd: invalid reconnect: %s\n", optarg);
return -1;
}
lwsl_notice(" start command: %s\n", server->command);
lwsl_notice(" close signal: %s (%d)\n", server->sig_name, server->sig_code);
lwsl_notice(" terminal type: %s\n", server->terminal_type);
- lwsl_notice(" reconnect timeout: %ds\n", server->reconnect);
+ if (server->reconnect > 0) {
+ lwsl_notice(" reconnect timeout: %ds\n", server->reconnect);
+ }
if (server->check_origin)
lwsl_notice(" check origin: true\n");
if (server->url_arg)