@@ -62,9 +62,10 @@ static void _service_run (srvmode_t mode, int rfdno, int wfdno);
62
62
#define NR_OPEN 1048576 /* works on RHEL 5 x86_64 arch */
63
63
#endif
64
64
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" ;
66
66
67
67
static const struct option longopts [] = {
68
+ {"foreground" , no_argument , 0 , 'f' },
68
69
{"rfdno" , required_argument , 0 , 'r' },
69
70
{"wfdno" , required_argument , 0 , 'w' },
70
71
{"debug" , required_argument , 0 , 'd' },
@@ -91,6 +92,7 @@ usage()
91
92
{
92
93
fprintf (stderr ,
93
94
"Usage: diod [OPTIONS]\n"
95
+ " -f,--foreground do not daemonize (default)\n"
94
96
" -r,--rfdno service connected client on read file descriptor\n"
95
97
" -w,--wfdno service connected client on write file descriptor\n"
96
98
" -l,--listen IP:PORT set interface to listen on (multiple -l allowed)\n"
@@ -143,6 +145,9 @@ main(int argc, char **argv)
143
145
opterr = 0 ;
144
146
while ((c = getopt_long (argc , argv , options , longopts , NULL )) != -1 ) {
145
147
switch (c ) {
148
+ case 'f' : /* --foreground */
149
+ /* no-op; this is the default now */
150
+ break ;
146
151
case 'r' : /* --rfdno */
147
152
mode = SRV_FILEDES ;
148
153
rfdno = strtoul (optarg , NULL , 10 );
0 commit comments