aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-02 20:30:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-02 20:30:28 +0200
commit78abf88dcc5d39ef3a36477300ed00a730ce6daa (patch)
tree4ce52634cdbe4de16189c98c0a0dcb1840acc139
parent43afd75ea8de1c891c3c0a520cbb117e3f1ad49e (diff)
downloadbusybox-w32-78abf88dcc5d39ef3a36477300ed00a730ce6daa.tar.gz
busybox-w32-78abf88dcc5d39ef3a36477300ed00a730ce6daa.tar.bz2
busybox-w32-78abf88dcc5d39ef3a36477300ed00a730ce6daa.zip
ifdown: use /var/run/udhcpc.%iface%.pid only if it exists
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ifupdown.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index bf88b1c19..2f3dd1d7b 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -573,8 +573,10 @@ static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec)
573static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec) 573static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec)
574{ 574{
575 int result; 575 int result;
576 result = execute("kill " 576 result = execute(
577 "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); 577 "test -f /var/run/udhcpc.%iface%.pid && "
578 "kill `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null",
579 ifd, exec);
578 /* Also bring the hardware interface down since 580 /* Also bring the hardware interface down since
579 killing the dhcp client alone doesn't do it. 581 killing the dhcp client alone doesn't do it.
580 This enables consecutive ifup->ifdown->ifup */ 582 This enables consecutive ifup->ifdown->ifup */