Fork as early as possible

If fork is requested, we fork as early as possible, way before anything
is initialized. This way, we don't need to do the gymnastics to make
OpenGL work properly across fork.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-02-08 01:27:46 +00:00
parent fec43acfaa
commit 5fffb6f3f6
5 changed files with 80 additions and 76 deletions

View File

@ -17,7 +17,7 @@ typedef struct session session_t;
/// Get config options that are needed to parse the rest of the options
/// Return true if we should quit
bool get_early_config(int argc, char *const *argv, char **config_file, bool *all_xerrors,
int *exit_code);
bool *fork, int *exit_code);
/**
* Process arguments and configuration files.