commit: adf811644540e0d5702337eeceb95d0b8a7bc4ff
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 11 17:39:08 2015 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Jan 15 15:28:58 2015 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=adf81164
Do not call exit with a negative value
This is undefined in POSIX.
---
init.d/net.lo.in | 2 +-
sh/functions.sh | 4 ++--
sh/systemd-wrapper.sh.in | 9 ++++-----
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index c79e7ff..e9e7f7c 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -22,7 +22,7 @@ if [ -f "$SHDIR/functions.sh" ]; then
. "$SHDIR/functions.sh"
else
echo "$SHDIR/functions.sh missing. Exiting"
- exit -1
+ exit 1
fi
depend()
diff --git a/sh/functions.sh b/sh/functions.sh
index 368bb73..0048a5f 100644
--- a/sh/functions.sh
+++ b/sh/functions.sh
@@ -12,7 +12,7 @@ elif [ -f /lib/gentoo/functions.sh ]; then
else
echo "/lib/gentoo/functions.sh not found. Exiting"
- exit -1
+ exit 1
fi
# runscript functions
@@ -119,7 +119,7 @@ get_interface() {
printf ${RC_IFACE};;
*)
eerror "Init system not supported. Aborting"
- exit -1;;
+ exit 1;;
esac
}
diff --git a/sh/systemd-wrapper.sh.in b/sh/systemd-wrapper.sh.in
index d931200..b26f976 100644
--- a/sh/systemd-wrapper.sh.in
+++ b/sh/systemd-wrapper.sh.in
@@ -14,7 +14,7 @@ usage() {
die() {
echo "$@"
- exit -1
+ exit 1
}
while getopts "i:" opt; do
@@ -49,8 +49,7 @@ fi
if [ -f "$INITDIR/${RC_SVCPREFIX}.lo" ]; then
. "$INITDIR/${RC_SVCPREFIX}.lo"
else
- echo "$INITDIR/${RC_SVCPREFIX}.lo : Init file missing or invalid path"
- exit -1
+ die "$INITDIR/${RC_SVCPREFIX}.lo : Init file missing or invalid path"
fi
netifrc_init() {
@@ -58,13 +57,13 @@ netifrc_init() {
mkdir -p "$OPTIONSDIR"
if [ ! -w "$OPTIONSDIR" ]; then
eerror "${OPTIONSDIR} does not exist or is not writeable"
- exit -1;
+ exit 1
fi
# Ensure STATEDIR is present and writeable
mkdir -p "$STATEDIR"
if [ ! -w "$STATEDIR" ]; then
eerror "${STATEDIR} does not exist or is not writeable"
- exit -1;
+ exit 1
fi
}