forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / is / isolate / take-config-file-from-env.patch
blobc42d9a6e45b830ffd3deeef6cbb21af41273e2f6
1 diff --git a/config.c b/config.c
2 index 6477259..c462ed3 100644
3 --- a/config.c
4 +++ b/config.c
5 @@ -114,9 +114,12 @@ cf_check(void)
6 void
7 cf_parse(void)
9 - FILE *f = fopen(CONFIG_FILE, "r");
10 + char *config_file = getenv("ISOLATE_CONFIG_FILE");
11 + if(!config_file)
12 + die("ISOLATE_CONFIG_FILE environment variable not set");
13 + FILE *f = fopen(config_file, "r");
14 if (!f)
15 - die("Cannot open %s: %m", CONFIG_FILE);
16 + die("Cannot open %s: %m", config_file);
18 char line[MAX_LINE_LEN];
19 while (fgets(line, sizeof(line), f))