Skip to content

Commit

Permalink
Command line parse errors should go to stdout/stderr
Browse files Browse the repository at this point in the history
A user trying to replicate why a daemon does not start need to see the
feedback on the terminal.

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Jan 2, 2024
1 parent cfbb154 commit acaa49f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/watchdogd.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,15 @@ int main(int argc, char *argv[])

case 't': /* Watchdog kick interval */
if (!optarg) {
ERROR("Missing interval argument.");
fprintf(stderr, "Missing interval argument.\n");
return usage(1);
}
opt_interval = atoi(optarg);
break;

case 'T': /* Watchdog timeout */
if (!optarg) {
ERROR("Missing timeout argument.");
fprintf(stderr, "Missing timeout argument.\n");
return usage(1);
}
opt_timeout = atoi(optarg);
Expand All @@ -272,7 +272,7 @@ int main(int argc, char *argv[])
break;

default:
ERROR("Unrecognized option '-%c'.\n", optopt);
fprintf(stderr, "Unrecognized option '-%c'.\n", optopt);
return usage(1);
}
}
Expand Down

0 comments on commit acaa49f

Please sign in to comment.