diff options
author | dteske <dteske@FreeBSD.org> | 2013-10-09 08:12:26 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-10-09 08:12:26 +0000 |
commit | ee2fafc6a903bcdb2569fc1d6c3ffce0f14c3ebd (patch) | |
tree | 4b1792e416c982abbc7d554b2fb8ab80ba5afb91 /usr.sbin/bsdconfig/networking/share/ipaddr.subr | |
parent | 255d648aec920f8660ba18ef659a9a08f5ee0198 (diff) | |
download | FreeBSD-src-ee2fafc6a903bcdb2569fc1d6c3ffce0f14c3ebd.zip FreeBSD-src-ee2fafc6a903bcdb2569fc1d6c3ffce0f14c3ebd.tar.gz |
Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-use
throughout the bsdconfig(8) code. While we're here, add an explicit argument
to lvalue-seeking invocations of "return" that previously had no argument.
Also, consolidate a single instance of double-newline and remove some
comments that are no longer required (given increased readability with new
exit codes).
Approved by: re (glebius)
Diffstat (limited to 'usr.sbin/bsdconfig/networking/share/ipaddr.subr')
-rw-r--r-- | usr.sbin/bsdconfig/networking/share/ipaddr.subr | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/bsdconfig/networking/share/ipaddr.subr b/usr.sbin/bsdconfig/networking/share/ipaddr.subr index 9c51f59..f67713a 100644 --- a/usr.sbin/bsdconfig/networking/share/ipaddr.subr +++ b/usr.sbin/bsdconfig/networking/share/ipaddr.subr @@ -147,7 +147,7 @@ f_dialog_input_ipaddr() local setting="$( printf "$msg_current_ipaddr" \ "$interface" "$_ipaddr" )" f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || - return $FAILURE + return $DIALOG_CANCEL fi local msg="$( printf "$msg_please_enter_new_ip_addr" "$interface" )" @@ -163,11 +163,11 @@ f_dialog_input_ipaddr() # - User has not made any changes to the given value # f_dialog_input _input "$msg" "$_ipaddr" \ - "$hline_num_punc_tab_enter" || return - [ "$_ipaddr" = "$_input" ] && return $FAILURE + "$hline_num_punc_tab_enter" || return $? + [ "$_ipaddr" = "$_input" ] && return $DIALOG_CANCEL # Return success if NULL value was entered - [ "$_input" ] || return $SUCCESS + [ "$_input" ] || return $DIALOG_OK # Take only the first "word" of the user's input _ipaddr="$_input" @@ -208,7 +208,7 @@ f_dialog_input_ipaddr() ipaddr="$_ipaddr" [ "$_netmask" ] && netmask="$_netmask" - return $SUCCESS + return $DIALOG_OK } ############################################################ MAIN |