public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Tobias Klausmann" <klausman@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/
Date: Sun,  2 Oct 2016 08:48:42 +0000 (UTC)	[thread overview]
Message-ID: <1475398119.741f6b4ca936e4fc82c99145bb8ced457149d28e.klausman@gentoo> (raw)

commit:     741f6b4ca936e4fc82c99145bb8ced457149d28e
Author:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  2 08:46:32 2016 +0000
Commit:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Sun Oct  2 08:48:39 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=741f6b4c

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.

 .../cronbase/{cronbase-0.3.7-r3.ebuild => cronbase-0.3.7-r4.ebuild}   | 0
 sys-process/cronbase/files/run-crons-0.3.7                            | 4 ++--
 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
similarity index 100%
rename from sys-process/cronbase/cronbase-0.3.7-r3.ebuild
rename to 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 ce8ff76..958ef06 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


             reply	other threads:[~2016-10-02  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-02  8:48 Tobias Klausmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-10-03 17:19 [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/ Tobias Klausmann
2016-09-30 14:17 Tobias Klausmann
2016-03-15  2:33 Mike Frysinger
2015-08-19 21:49 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1475398119.741f6b4ca936e4fc82c99145bb8ced457149d28e.klausman@gentoo \
    --to=klausman@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox