Don't print errors from the DHCP endpoint
This commit is contained in:
parent
139f35d9d4
commit
63935a1b5f
1 changed files with 6 additions and 1 deletions
|
@ -36,6 +36,8 @@ tryendpoint(struct system_config *sc,
|
||||||
int (fetch)(struct system_config *),
|
int (fetch)(struct system_config *),
|
||||||
int (next)(struct system_config *))
|
int (next)(struct system_config *))
|
||||||
{
|
{
|
||||||
|
int errfd = -1, ret;
|
||||||
|
|
||||||
free(sc->sc_endpoint);
|
free(sc->sc_endpoint);
|
||||||
sc->sc_endpoint = NULL;
|
sc->sc_endpoint = NULL;
|
||||||
|
|
||||||
|
@ -59,7 +61,10 @@ tryendpoint(struct system_config *sc,
|
||||||
return (*next)(sc);
|
return (*next)(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*fetch)(sc) != 0)
|
errfd = disable_output(sc, STDERR_FILENO);
|
||||||
|
ret = (*fetch)(sc);
|
||||||
|
enable_output(sc, STDERR_FILENO, errfd);
|
||||||
|
if (ret != 0)
|
||||||
return tryendpoint(sc, fetch, next);
|
return tryendpoint(sc, fetch, next);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
|
Loading…
Reference in a new issue