Daemonise if so desired
This commit is contained in:
parent
c0883294ef
commit
d70a9a130b
@ -16,7 +16,7 @@ short difflog = 0;
|
||||
void usage(argv)
|
||||
const char* argv;
|
||||
{
|
||||
fprintf(stderr, "%s: usage: %s [-h] [-c config] [-l log]\n", argv, argv);
|
||||
fprintf(stderr, "%s: usage: %s [-hd] [-c config] [-l log]\n", argv, argv);
|
||||
}
|
||||
|
||||
int main(argc, argv)
|
||||
@ -25,7 +25,7 @@ int main(argc, argv)
|
||||
{
|
||||
int c;
|
||||
cf.cfile = CONFIGFILE;
|
||||
#define OPTSTRING "hc:l:"
|
||||
#define OPTSTRING "dhc:l:"
|
||||
while((c = getopt(argc, argv, OPTSTRING)) != -1)
|
||||
switch(c) {
|
||||
case 'c':
|
||||
@ -38,6 +38,9 @@ int main(argc, argv)
|
||||
cf.logfile = strdup(optarg);
|
||||
difflog = 1;
|
||||
break;
|
||||
case 'd':
|
||||
daemon(0, 0);
|
||||
break;
|
||||
default:
|
||||
usage(strdup(*argv));
|
||||
return -2;
|
||||
|
Loading…
Reference in New Issue
Block a user