From: Roy Marples Date: Sat, 15 Nov 2008 11:24:26 +0000 (+0000) Subject: Fork into background even with no interfaces IF we are asked to background AND have... X-Git-Tag: v5.0.0~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b9d0731c3ac128498c7110f1e1f1e8d0868c820;p=thirdparty%2Fdhcpcd.git Fork into background even with no interfaces IF we are asked to background AND have link detection. --- diff --git a/dhcpcd.c b/dhcpcd.c index d82c5eb0..f34d4d86 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1312,12 +1312,19 @@ main(int argc, char **argv) if (strcmp(iface->name, ifv[i]) == 0) break; if (!iface) - syslog(LOG_ERR, "%s: invalid interface", ifv[i]); + syslog(LOG_ERR, "%s: interface not found or invalid", + ifv[i]); } if (!ifaces) { if (ifc == 0) syslog(LOG_ERR, "no valid interfaces found"); - exit(EXIT_FAILURE); + if (!(options & DHCPCD_BACKGROUND) || + !(options & DHCPCD_LINK)) + { + syslog(LOG_ERR, "aborting as we're not backgrounding" + " with link detection"); + exit(EXIT_FAILURE); + } } if (options & DHCPCD_BACKGROUND)