diff --git a/include/exit_code.h b/include/flag.h similarity index 70% rename from include/exit_code.h rename to include/flag.h index 9dd375b..dc0cf2c 100644 --- a/include/exit_code.h +++ b/include/flag.h @@ -1,6 +1,14 @@ #ifndef _EXIT_CODE_H_ #define _EXIT_CODE_H_ +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + #define EXIT_NORMAL 0 #define EXIT_FILE_ERROR 1 #define EXIT_FORK_ERROR 2 diff --git a/src/common.c b/src/common.c index 9dceb22..d1021d7 100644 --- a/src/common.c +++ b/src/common.c @@ -2,7 +2,7 @@ #include #include #include "cJSON.h" -#include "exit_code.h" +#include "flag.h" char **adguard_command = NULL; char **overture_command = NULL; diff --git a/src/process.c b/src/process.c index aefa793..b8b8224 100644 --- a/src/process.c +++ b/src/process.c @@ -7,15 +7,7 @@ #include #include #include "common.h" -#include "exit_code.h" - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif +#include "flag.h" int exiting = 0; @@ -73,7 +65,7 @@ void server_exit(int exit_code) { // kill sub process and exit if (custom_pgid != 0) { ret = waitpid(-custom_pgid, &status, WNOHANG); if (ret == 0) { // custom script still running - fprintf(stderr, "[ClearDNS] Kill custom script.\n"); + fprintf(stderr, "[ClearDNS] Kill custom script. (pgid = %d)\n", custom_pgid); kill(-custom_pgid, SIGTERM); // kill process group } }