dynstage: don't destroy library filewatch on deletion
This commit is contained in:
parent
c668267888
commit
d2c01b8ce5
1 changed files with 4 additions and 7 deletions
|
@ -55,7 +55,6 @@ static struct {
|
|||
int recompile_delay;
|
||||
int rescan_delay;
|
||||
int lib_gen_bump_delay;
|
||||
pid_t recompile_pid;
|
||||
} dynstage;
|
||||
|
||||
static stageslib_t dynstage_dlopen(void) {
|
||||
|
@ -129,12 +128,12 @@ static bool dynstage_filewatch_event(SDL_Event *e, void *ctx) {
|
|||
if(watch == dynstage.lib_watch) {
|
||||
switch(fevent) {
|
||||
case FILEWATCH_FILE_UPDATED:
|
||||
log_debug("Library updated");
|
||||
dynstage_bump_lib_generation();
|
||||
break;
|
||||
|
||||
case FILEWATCH_FILE_DELETED:
|
||||
filewatch_unwatch(dynstage.lib_watch);
|
||||
dynstage.lib_watch = NULL;
|
||||
log_debug("Library deleted");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -149,13 +148,11 @@ static bool dynstage_filewatch_event(SDL_Event *e, void *ctx) {
|
|||
}
|
||||
|
||||
static void dynstage_sigchld(int sig, siginfo_t *sinfo, void *ctx) {
|
||||
pid_t cpid;
|
||||
attr_unused pid_t cpid;
|
||||
int status;
|
||||
|
||||
while((cpid = waitpid(-1, &status, WNOHANG)) > 0) {
|
||||
if(cpid == dynstage.recompile_pid) {
|
||||
dynstage.recompile_pid = 0;
|
||||
}
|
||||
log_debug("Process %i terminated with status %i", cpid, status);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue