Skip to content

Commit

Permalink
Merge pull request #134 from a3f/reinstate-foreground-option
Browse files Browse the repository at this point in the history
diod: keep --foreground option for compatibility
  • Loading branch information
mergify[bot] authored Feb 5, 2025
2 parents ecc22bf + 539827e commit a140080
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cmd/diod.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ static void _service_run (srvmode_t mode, int rfdno, int wfdno);
#define NR_OPEN 1048576 /* works on RHEL 5 x86_64 arch */
#endif

static const char *options = "r:w:d:l:t:e:Eo:u:SL:nHpc:NU:s";
static const char *options = "fr:w:d:l:t:e:Eo:u:SL:nHpc:NU:s";

static const struct option longopts[] = {
{"foreground", no_argument, 0, 'f'},
{"rfdno", required_argument, 0, 'r'},
{"wfdno", required_argument, 0, 'w'},
{"debug", required_argument, 0, 'd'},
Expand All @@ -91,6 +92,7 @@ usage()
{
fprintf (stderr,
"Usage: diod [OPTIONS]\n"
" -f,--foreground do not daemonize (default)\n"
" -r,--rfdno service connected client on read file descriptor\n"
" -w,--wfdno service connected client on write file descriptor\n"
" -l,--listen IP:PORT set interface to listen on (multiple -l allowed)\n"
Expand Down Expand Up @@ -143,6 +145,9 @@ main(int argc, char **argv)
opterr = 0;
while ((c = getopt_long (argc, argv, options, longopts, NULL)) != -1) {
switch (c) {
case 'f': /* --foreground */
/* no-op; this is the default now */
break;
case 'r': /* --rfdno */
mode = SRV_FILEDES;
rfdno = strtoul (optarg, NULL, 10);
Expand Down

0 comments on commit a140080

Please sign in to comment.