summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-02-18 08:07:10 +0000
committerRoy Marples <roy@marples.name>2009-02-18 08:07:10 +0000
commit2d775a6758c247e2ab22e8c7f9252e818217736e (patch)
tree96332916a35d1a0cf3c5aeb3a5c9ce32bb3fd56c
parentc9fc4ec4b90fb8a029a16ccc934368b68c2a51c3 (diff)
downloaddhcpcd-2d775a6758c247e2ab22e8c7f9252e818217736e.tar.xz
Only auto background with no interfaces.
-rw-r--r--dhcpcd.8.in2
-rw-r--r--dhcpcd.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/dhcpcd.8.in b/dhcpcd.8.in
index c2494fa7..395a0b2a 100644
--- a/dhcpcd.8.in
+++ b/dhcpcd.8.in
@@ -114,7 +114,7 @@ If a list of interfaces are given on the command line, then
only works with those interfaces, otherwise
.Nm
discovers available interfaces.
-If link management is enabled and none or more than one interfaces are given,
+If link management is enabled and no interfaces are given on the command line,
.Nm
forks to the background right away.
.Pp
diff --git a/dhcpcd.c b/dhcpcd.c
index ec275266..0db9ee63 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1460,10 +1460,8 @@ main(int argc, char **argv)
ifc = argc - optind;
ifv = argv + optind;
- if (ifc != 1) {
- if (options & (DHCPCD_LINK | DHCPCD_DAEMONISE))
- daemonise();
- }
+ if (ifc == 0 && options & (DHCPCD_LINK | DHCPCD_DAEMONISE))
+ daemonise();
ifaces = discover_interfaces(ifc, ifv);
for (i = 0; i < ifc; i++) {