From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 00402138330 for ; Sun, 2 Oct 2016 08:48:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 52425E0B7F; Sun, 2 Oct 2016 08:48:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3A17CE0B7F for ; Sun, 2 Oct 2016 08:48:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 05C88340BBE for ; Sun, 2 Oct 2016 08:48:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A0DA1248C for ; Sun, 2 Oct 2016 08:48:42 +0000 (UTC) From: "Tobias Klausmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tobias Klausmann" Message-ID: <1475398119.741f6b4ca936e4fc82c99145bb8ced457149d28e.klausman@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-process/cronbase/cronbase-0.3.7-r3.ebuild sys-process/cronbase/cronbase-0.3.7-r4.ebuild sys-process/cronbase/files/run-crons-0.3.7 X-VCS-Directories: sys-process/cronbase/files/ sys-process/cronbase/ X-VCS-Committer: klausman X-VCS-Committer-Name: Tobias Klausmann X-VCS-Revision: 741f6b4ca936e4fc82c99145bb8ced457149d28e X-VCS-Branch: master Date: Sun, 2 Oct 2016 08:48:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4ac4dcc9-43e9-40d6-bf59-90002b8e4df3 X-Archives-Hash: c77348d943678e5e10fdd5bf458c5b00 commit: 741f6b4ca936e4fc82c99145bb8ced457149d28e Author: Tobias Klausmann gentoo org> AuthorDate: Sun Oct 2 08:46:32 2016 +0000 Commit: Tobias Klausmann gentoo 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