mirror of https://github.com/ValdikSS/GoodbyeDPI
Browse Source
The 'exiting' variable is accessed from signal handler context and should use sig_atomic_t type with volatile qualifier as required by the C standard. Remove calls to deinit_all() and exit() from sigint_handler since neither WinDivertShutdown/WinDivertClose nor exit() are async-signal-safe functions. Move cleanup to after the main loop. Also register SIGTERM in addition to SIGINT so that the handler is invoked when the process is terminated via GUI close button, and change the main loop condition from while(1) to while(!exiting) so that the flag is checked on every iteration. Closes #770pull/838/head
1 changed files with 6 additions and 5 deletions
Loading…
Reference in new issue