summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klausmann <klausman@gentoo.org>2016-10-02 10:46:32 +0200
committerTobias Klausmann <klausman@gentoo.org>2016-10-02 10:48:39 +0200
commit741f6b4ca936e4fc82c99145bb8ced457149d28e (patch)
tree9ac6bfbbe7a06d9b29694864812ba87310b3f63c /sys-process/cronbase
parentdev-ruby/rake: Stable for HPPA (bug #586862). (diff)
downloadgentoo-741f6b4ca936e4fc82c99145bb8ced457149d28e.tar.gz
gentoo-741f6b4ca936e4fc82c99145bb8ced457149d28e.tar.bz2
gentoo-741f6b4ca936e4fc82c99145bb8ced457149d28e.zip
sys-process/cronbase: More fixes
The tr approach is racy, even with the test -r before it. Since tr can't be told to read from a file and we can't redirect the subshell's warning message, switch to sed and a file argument, then redirect stderr of that.
Diffstat (limited to 'sys-process/cronbase')
-rw-r--r--sys-process/cronbase/cronbase-0.3.7-r4.ebuild (renamed from sys-process/cronbase/cronbase-0.3.7-r3.ebuild)0
-rwxr-xr-xsys-process/cronbase/files/run-crons-0.3.74
2 files changed, 2 insertions, 2 deletions
diff --git a/sys-process/cronbase/cronbase-0.3.7-r3.ebuild b/sys-process/cronbase/cronbase-0.3.7-r4.ebuild
index d263aeb11e0e..d263aeb11e0e 100644
--- a/sys-process/cronbase/cronbase-0.3.7-r3.ebuild
+++ b/sys-process/cronbase/cronbase-0.3.7-r4.ebuild
diff --git a/sys-process/cronbase/files/run-crons-0.3.7 b/sys-process/cronbase/files/run-crons-0.3.7
index ce8ff76e98bb..958ef06c1ef7 100755
--- a/sys-process/cronbase/files/run-crons-0.3.7
+++ b/sys-process/cronbase/files/run-crons-0.3.7
@@ -58,8 +58,8 @@ grab_lock() {
# another run-crons process.
# The tr call deletes null bytes so newer bash versions do not complain
# about them.
- cmdline1=$([ -r "/proc/${cronpid}/cmdline" ] && tr -d '\0' < "/proc/${cronpid}/cmdline" 2>/dev/null) || :
- cmdline2=$(tr -d '\0' < /proc/$$/cmdline)
+ cmdline1=$(sed -e 's/\0/ /g' "/proc/${cronpid}/cmdline" 2>/dev/null) || :
+ cmdline2=$(sed -e 's/\0/ /g' /proc/$$/cmdline)
if [ "${cmdline1}" = "${cmdline2}" ] ; then
# Whoa, another run-crons is really running.
return 1