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

Add "no-daemon" option #42

Merged
merged 1 commit into from
May 10, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion FTL.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,4 @@ char * username;
char timestamp[16];
bool flush;
bool needGC;

bool daemonmode;
6 changes: 6 additions & 0 deletions args.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "version.h"

bool debug = false;
bool daemonmode = true;
bool debugthreads = false;
bool debugclients = false;
bool debugGC = false;
Expand Down Expand Up @@ -64,6 +65,11 @@ void parse_args(int argc, char* argv[])
runtest = true;
}

if(strcmp(argv[i], "no-daemon") == 0 || strcmp(argv[i], "-f") == 0)
{
daemonmode = false;
}

// Other arguments are ignored
}
}
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int main (int argc, char* argv[]) {

read_FTLconf();

if(!debug)
if(!debug && daemonmode)
go_daemon();
else
savepid();
Expand Down