Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diod: keep --foreground option for compatibility #134

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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