mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix longjump() compiler warnings.
This commit is contained in:
36
src/option.c
36
src/option.c
@@ -4974,26 +4974,20 @@ err:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_file(char *file, FILE *f, int hard_opt)
|
static void read_file(char *file, FILE *f, int hard_opt, int from_script)
|
||||||
{
|
{
|
||||||
volatile int lineno = 0;
|
volatile int lineno = 0;
|
||||||
char *buff = daemon->namebuff;
|
char *buff = daemon->namebuff;
|
||||||
|
|
||||||
while (fgets(buff, MAXDNAME, f))
|
while (fgets(buff, MAXDNAME, f))
|
||||||
{
|
{
|
||||||
int white, i, script = 0;
|
int white, i;
|
||||||
volatile int option;
|
volatile int option;
|
||||||
char *errmess, *p, *arg, *start;
|
char *errmess, *p, *arg, *start;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if (hard_opt == LOPT_CONF_SCRIPT)
|
|
||||||
{
|
|
||||||
hard_opt = 0;
|
|
||||||
script = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
option = (hard_opt == LOPT_REV_SERV) ? 0 : hard_opt;
|
option = (hard_opt == LOPT_REV_SERV) ? 0 : hard_opt;
|
||||||
|
|
||||||
/* Memory allocation failure longjmps here if mem_recover == 1 */
|
/* Memory allocation failure longjmps here if mem_recover == 1 */
|
||||||
if (option != 0 || hard_opt == LOPT_REV_SERV)
|
if (option != 0 || hard_opt == LOPT_REV_SERV)
|
||||||
{
|
{
|
||||||
@@ -5001,7 +4995,7 @@ static void read_file(char *file, FILE *f, int hard_opt)
|
|||||||
continue;
|
continue;
|
||||||
mem_recover = 1;
|
mem_recover = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
arg = NULL;
|
arg = NULL;
|
||||||
lineno++;
|
lineno++;
|
||||||
errmess = NULL;
|
errmess = NULL;
|
||||||
@@ -5107,7 +5101,7 @@ static void read_file(char *file, FILE *f, int hard_opt)
|
|||||||
|
|
||||||
if (errmess || !one_opt(option, arg, daemon->namebuff, _("error"), 0, hard_opt == LOPT_REV_SERV))
|
if (errmess || !one_opt(option, arg, daemon->namebuff, _("error"), 0, hard_opt == LOPT_REV_SERV))
|
||||||
{
|
{
|
||||||
if (script)
|
if (from_script)
|
||||||
sprintf(daemon->namebuff + strlen(daemon->namebuff), _(" in output from %s"), file);
|
sprintf(daemon->namebuff + strlen(daemon->namebuff), _(" in output from %s"), file);
|
||||||
else
|
else
|
||||||
sprintf(daemon->namebuff + strlen(daemon->namebuff), _(" at line %d of %s"), lineno, file);
|
sprintf(daemon->namebuff + strlen(daemon->namebuff), _(" at line %d of %s"), lineno, file);
|
||||||
@@ -5153,8 +5147,14 @@ static int one_file(char *file, int hard_opt)
|
|||||||
hard_opt = 0;
|
hard_opt = 0;
|
||||||
nofile_ok = 1;
|
nofile_ok = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hard_opt == 0 && strcmp(file, "-") == 0)
|
if (hard_opt == LOPT_CONF_SCRIPT)
|
||||||
|
{
|
||||||
|
hard_opt = 0;
|
||||||
|
do_popen = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hard_opt == 0 && !do_popen && strcmp(file, "-") == 0)
|
||||||
{
|
{
|
||||||
if (read_stdin == 1)
|
if (read_stdin == 1)
|
||||||
return 1;
|
return 1;
|
||||||
@@ -5167,12 +5167,6 @@ static int one_file(char *file, int hard_opt)
|
|||||||
/* ignore repeated files. */
|
/* ignore repeated files. */
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
|
|
||||||
if (hard_opt == LOPT_CONF_SCRIPT)
|
|
||||||
{
|
|
||||||
hard_opt = 0;
|
|
||||||
do_popen = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hard_opt == 0 && stat(file, &statbuf) == 0)
|
if (hard_opt == 0 && stat(file, &statbuf) == 0)
|
||||||
{
|
{
|
||||||
struct fileread *r;
|
struct fileread *r;
|
||||||
@@ -5211,7 +5205,7 @@ static int one_file(char *file, int hard_opt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
read_file(file, f, do_popen ? LOPT_CONF_SCRIPT : hard_opt);
|
read_file(file, f, hard_opt, do_popen);
|
||||||
|
|
||||||
if (do_popen)
|
if (do_popen)
|
||||||
{
|
{
|
||||||
@@ -5365,7 +5359,7 @@ void read_servers_file(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mark_servers(SERV_FROM_FILE);
|
mark_servers(SERV_FROM_FILE);
|
||||||
read_file(daemon->servers_file, f, LOPT_REV_SERV);
|
read_file(daemon->servers_file, f, LOPT_REV_SERV, 0);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
cleanup_servers();
|
cleanup_servers();
|
||||||
check_servers(0);
|
check_servers(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user