aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ali Polatel <polatel@gmail.com> 2009-08-23 13:35:03 +0300
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-08-23 16:16:32 +0100
commitffb0552e3490960611ca7a90080be8ac46d3bdea (patch)
treecb040c1503b464f366428852d956db98f4fc8a35
parentdb7e41d6f5c555f5af060ce37f6853e5965d72c5 (diff)
downloadpaludis-ffb0552e3490960611ca7a90080be8ac46d3bdea.tar.gz
paludis-ffb0552e3490960611ca7a90080be8ac46d3bdea.tar.xz
Replace magic open() calls with magic stat()
Signed-off-by: Ali Polatel <polatel@gmail.com>
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash2
-rw-r--r--paludis/repositories/e/ebuild/sydbox.bash12
2 files changed, 5 insertions, 9 deletions
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 187bed6..b552a79 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -461,7 +461,7 @@ perform_hook()
local old_sandbox_on="${SANDBOX_ON}"
local old_sydbox_enabled
- sydboxcheck enabled 2>/dev/null && old_sydbox_enabled=true || old_sydbox_enabled=false
+ sydboxcmd enabled 2>/dev/null && old_sydbox_enabled=true || old_sydbox_enabled=false
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
export SANDBOX_ON="0"
if sydboxcheck 2>/dev/null; then
diff --git a/paludis/repositories/e/ebuild/sydbox.bash b/paludis/repositories/e/ebuild/sydbox.bash
index 1fb32ea..6e47d50 100644
--- a/paludis/repositories/e/ebuild/sydbox.bash
+++ b/paludis/repositories/e/ebuild/sydbox.bash
@@ -22,21 +22,17 @@
sydboxcheck()
{
- if [[ -z "${1}" ]]; then
- [[ -e /dev/sydbox ]]
- else
- [[ -e /dev/sydbox/${1} ]]
- fi
+ [[ -e /dev/sydbox ]]
}
sydboxcmd()
{
- if sydboxcheck ${1}; then
+ if sydboxcheck; then
if [[ -n "${2}" ]]; then
[[ "/" != "${2:0:1}" ]] && die "${FUNCNAME} ${1}: non-absolute path"
- : > /dev/sydbox/${1}/"${2}"
+ [[ -e /dev/sydbox/${1}/"${2}" ]]
else
- : > /dev/sydbox/${1}
+ [[ -e /dev/sydbox/${1} ]]
fi
fi
}