diff options
author | Tobias Klausmann <klausman@gentoo.org> | 2016-09-30 09:22:54 +0200 |
---|---|---|
committer | Tobias Klausmann <klausman@gentoo.org> | 2016-09-30 09:25:22 +0200 |
commit | 7c266d7a1854b3b1b543fb35036d3e4e6c3135cf (patch) | |
tree | aca46708236eae6d644c7ab85934f60c76102062 /sys-process | |
parent | dev-python/requests: Removed old. (diff) | |
download | gentoo-7c266d7a1854b3b1b543fb35036d3e4e6c3135cf.tar.gz gentoo-7c266d7a1854b3b1b543fb35036d3e4e6c3135cf.tar.bz2 gentoo-7c266d7a1854b3b1b543fb35036d3e4e6c3135cf.zip |
sys-process/cronbase: avoid bash complaining about null bytes
Newer versions of bash warn about null bytes in command substitutions,
so run-crons would generate mails with messages like this:
/usr/sbin/run-crons: line 59: warning: command substitution: ignored null byte in input
/usr/sbin/run-crons: line 59: warning: command substitution: ignored null byte in input
/usr/sbin/run-crons: line 60: warning: command substitution: ignored null byte in input
/usr/sbin/run-crons: line 60: warning: command substitution: ignored null byte in input
Since the warning is not useful and the resultant string has its null
bytes deleted, we might as well delete them with tr and get rid of the
warning.
Diffstat (limited to 'sys-process')
-rw-r--r-- | sys-process/cronbase/cronbase-0.3.7-r2.ebuild (renamed from sys-process/cronbase/cronbase-0.3.7-r1.ebuild) | 0 | ||||
-rwxr-xr-x | sys-process/cronbase/files/run-crons-0.3.7 | 6 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys-process/cronbase/cronbase-0.3.7-r1.ebuild b/sys-process/cronbase/cronbase-0.3.7-r2.ebuild index d263aeb11e0e..d263aeb11e0e 100644 --- a/sys-process/cronbase/cronbase-0.3.7-r1.ebuild +++ b/sys-process/cronbase/cronbase-0.3.7-r2.ebuild diff --git a/sys-process/cronbase/files/run-crons-0.3.7 b/sys-process/cronbase/files/run-crons-0.3.7 index c661c77a43fa..c5f2d9ca7b33 100755 --- a/sys-process/cronbase/files/run-crons-0.3.7 +++ b/sys-process/cronbase/files/run-crons-0.3.7 @@ -56,8 +56,10 @@ grab_lock() { # This is better than kill -0 because we can verify that it's really # another run-crons process. - cmdline1=$(cat "/proc/${cronpid}/cmdline" 2>/dev/null) || : - cmdline2=$(cat /proc/$$/cmdline) + # The tr call deletes null bytes so newer bash versions do not complain + # about them. + cmdline1=$(tr -d '\0' < "/proc/${cronpid}/cmdline" 2>/dev/null) || : + cmdline2=$(tr -d '\0' < /proc/$$/cmdline) if [ "${cmdline1}" = "${cmdline2}" ] ; then # Whoa, another run-crons is really running. return 1 |