Skip to content

Commit a140080

Browse files
authored
Merge pull request #134 from a3f/reinstate-foreground-option
diod: keep --foreground option for compatibility
2 parents ecc22bf + 539827e commit a140080

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/cmd/diod.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ static void _service_run (srvmode_t mode, int rfdno, int wfdno);
6262
#define NR_OPEN 1048576 /* works on RHEL 5 x86_64 arch */
6363
#endif
6464

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

6767
static const struct option longopts[] = {
68+
{"foreground", no_argument, 0, 'f'},
6869
{"rfdno", required_argument, 0, 'r'},
6970
{"wfdno", required_argument, 0, 'w'},
7071
{"debug", required_argument, 0, 'd'},
@@ -91,6 +92,7 @@ usage()
9192
{
9293
fprintf (stderr,
9394
"Usage: diod [OPTIONS]\n"
95+
" -f,--foreground do not daemonize (default)\n"
9496
" -r,--rfdno service connected client on read file descriptor\n"
9597
" -w,--wfdno service connected client on write file descriptor\n"
9698
" -l,--listen IP:PORT set interface to listen on (multiple -l allowed)\n"
@@ -143,6 +145,9 @@ main(int argc, char **argv)
143145
opterr = 0;
144146
while ((c = getopt_long (argc, argv, options, longopts, NULL)) != -1) {
145147
switch (c) {
148+
case 'f': /* --foreground */
149+
/* no-op; this is the default now */
150+
break;
146151
case 'r': /* --rfdno */
147152
mode = SRV_FILEDES;
148153
rfdno = strtoul (optarg, NULL, 10);

0 commit comments

Comments
 (0)