Don't print errors from the DHCP endpoint

This commit is contained in:
reykfloeter 2019-06-02 03:13:58 +02:00
parent 139f35d9d4
commit 63935a1b5f
1 changed files with 6 additions and 1 deletions

View File

@ -36,6 +36,8 @@ tryendpoint(struct system_config *sc,
int (fetch)(struct system_config *),
int (next)(struct system_config *))
{
int errfd = -1, ret;
free(sc->sc_endpoint);
sc->sc_endpoint = NULL;
@ -59,7 +61,10 @@ tryendpoint(struct system_config *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 (0);