summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-eselect/eselect-php/files')
-rw-r--r--app-eselect/eselect-php/files/php-fpm-launcher-r19
-rw-r--r--app-eselect/eselect-php/files/php-fpm-launcher-r215
2 files changed, 15 insertions, 9 deletions
diff --git a/app-eselect/eselect-php/files/php-fpm-launcher-r1 b/app-eselect/eselect-php/files/php-fpm-launcher-r1
deleted file mode 100644
index c7cc2e983a01..000000000000
--- a/app-eselect/eselect-php/files/php-fpm-launcher-r1
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-source /lib/gentoo/functions.sh
-
-PHPSLOT="${1}"
-[ -z "${PHPSLOT}" ] && PHPSLOT="$(eselect php show fpm)"
-shift
-
-exec /usr/$(get_libdir)/${PHPSLOT}/bin/php-fpm "${@}"
diff --git a/app-eselect/eselect-php/files/php-fpm-launcher-r2 b/app-eselect/eselect-php/files/php-fpm-launcher-r2
new file mode 100644
index 000000000000..db07a1352d8c
--- /dev/null
+++ b/app-eselect/eselect-php/files/php-fpm-launcher-r2
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -o errexit
+
+. /lib/gentoo/functions.sh
+
+# If there are no arguments, then "shift" will fail (bug 626496).
+if [ $# -eq 0 ]; then
+ PHP_SLOT=$(eselect php show fpm)
+else
+ PHP_SLOT=$1
+ shift
+fi
+
+exec "/usr/$(get_libdir)/${PHP_SLOT}/bin/php-fpm" "${@}"