diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-07-24 15:29:46 +0000 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-07-28 01:03:56 +0200 |
commit | 18308a6e42b82ad5a6c3ddf46c63c6601b9fac84 (patch) | |
tree | c07aec3a4de527c3b9a194a3719ff11934fadd31 /main/paxmark/paxmark | |
parent | 831eb5589dc9d1ef397f27c9c4e402e82f8bda57 (diff) | |
download | aports-18308a6e42b82ad5a6c3ddf46c63c6601b9fac84.tar.bz2 aports-18308a6e42b82ad5a6c3ddf46c63c6601b9fac84.tar.xz |
main/paxmark: follow POSIX with 'return' vs 'exit'
The 'return' builtin is used for functions and dot scripts only:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#return
This means that paxmark has undefined behaviour. When /bin/sh is
bash, an error is output:
/usr/sbin/paxmark: line 32: return: can only `return' from a function or sourced script
This commit replaces 'return' with POSIX standard 'exit'.
Diffstat (limited to 'main/paxmark/paxmark')
-rw-r--r-- | main/paxmark/paxmark | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/paxmark/paxmark b/main/paxmark/paxmark index a279ed98d9..f80eb69ffe 100644 --- a/main/paxmark/paxmark +++ b/main/paxmark/paxmark @@ -2,7 +2,7 @@ ret=0 flags="${1//[!zPpEeMmRrSs]}" -[ -n "${flags}" ] || return 0 +[ -n "${flags}" ] || exit 0 shift # Create XATTR_PAX marking using attr @@ -29,5 +29,5 @@ for f in "$@"; do attr -q -s pax.flags -V "${xval}" "${f}" >/dev/null || ret=1 done -return $ret +exit $ret |