Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 718114 | Differences between
and this patch

Collapse All | Expand All

(-)a/net/dhcpcd.sh (-7 / +14 lines)
Lines 16-26 _config_vars="$_config_vars dhcp dhcpcd" Link Here
16
16
17
dhcpcd_start()
17
dhcpcd_start()
18
{
18
{
19
	# check for pidfile after we gathered the user's opts because they can
19
	# check for pidfile after we gathered the user's args because they can
20
	# alter the pidfile's name (#718114)
20
	# alter the pidfile's name (#718114)
21
	local args= opt= pidfile= opts= new=true
21
	# Save the args into a file so dhcpcd_stop can later re-use the very
22
	# same args later.
23
	local args= opt= pidfile= opts= new=true argsfile=/run/netifrc_dhcpcd_${IFACE}_args
22
	eval args=\$dhcpcd_${IFVAR}
24
	eval args=\$dhcpcd_${IFVAR}
23
	[ -z "${args}" ] && args=${dhcpcd}
25
	[ -z "${args}" ] && args=${dhcpcd}
26
	echo "${args}" > ${argsfile}
24
	pidfile="$(dhcpcd -P ${args} ${IFACE})"
27
	pidfile="$(dhcpcd -P ${args} ${IFACE})"
25
28
26
	# Get our options
29
	# Get our options
Lines 78-89 dhcpcd_start() Link Here
78
81
79
dhcpcd_stop()
82
dhcpcd_stop()
80
{
83
{
81
	local args= pidfile= opts= sig=SIGTERM
84
	local args= pidfile= opts= sig=SIGTERM argsfile=/run/netifrc_dhcpcd_${IFACE}_args
82
85
83
	# check for pidfile after we gathered the user's opts because they can
86
	# check for pidfile after we gathered the user's args because they can
84
	# alter the pidfile's name (#718114)
87
	# alter the pidfile's name (#718114)
85
	eval args=\$dhcpcd_${IFVAR}
88
	if [ -f "${argsfile}" ] ; then
86
	[ -z "${args}" ] && args=${dhcpcd}
89
		args="$(cat ${argsfile})"
90
	else
91
		eval args=\$dhcpcd_${IFVAR}
92
		[ -z "${args}" ] && args=${dhcpcd}
93
	fi
87
	pidfile="$(dhcpcd -P ${args} ${IFACE})"
94
	pidfile="$(dhcpcd -P ${args} ${IFACE})"
88
	[ ! -f "${pidfile}" ] && return 0
95
	[ ! -f "${pidfile}" ] && return 0
89
96
Lines 94-98 dhcpcd_stop() Link Here
94
		*" release "*) dhcpcd -k "${IFACE}" ;;
101
		*" release "*) dhcpcd -k "${IFACE}" ;;
95
		*) dhcpcd -x "${IFACE}" ;;
102
		*) dhcpcd -x "${IFACE}" ;;
96
	esac
103
	esac
104
	[ -f "${argsfile}" ] && rm -f "${argsfile}"
97
	eend $?
105
	eend $?
98
}
106
}
99
- 

Return to bug 718114