Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Unified Diff: crash_sender

Issue 3122024: Hard fail immediately in crash_sender if /usr/bin/find is not installed (Closed) Base URL: ssh://git@chromiumos-git//crash-reporter.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crash_sender
diff --git a/crash_sender b/crash_sender
index 6da893354c4ad918d2685df7bb628e7a06f80428..99cc0def35af0540bc0095b42e4a99214c1fe662 100644
--- a/crash_sender
+++ b/crash_sender
@@ -13,6 +13,9 @@ CHROMEOS_PRODUCT=ChromeOS
# contents includes our machine's anonymized guid.
CONSENT_ID="/home/chronos/Consent To Send Stats"
+# Path to find which is required for computing the crash rate.
+FIND="/usr/bin/find"
+
# Send up to 8 crashes per day.
MAX_CRASH_RATE=8
@@ -101,7 +104,7 @@ is_on_3g() {
check_rate() {
mkdir -p ${TIMESTAMPS_DIR}
# Only consider minidumps written in the past 24 hours by removing all older.
- find "${TIMESTAMPS_DIR}" -mindepth 1 -mmin +$((24 * 60)) -exec rm '{}' ';'
+ ${FIND} "${TIMESTAMPS_DIR}" -mindepth 1 -mmin +$((24 * 60)) -exec rm '{}' ';'
local sends_in_24hrs=$(echo "${TIMESTAMPS_DIR}"/* | wc -w)
lecho "Current send rate: ${sends_in_24hrs}sends/24hrs"
if [ ${sends_in_24hrs} -ge ${MAX_CRASH_RATE} ]; then
@@ -225,6 +228,11 @@ main() {
check_not_already_running
+ if [ ! -x "${FIND}" ]; then
+ lecho "Fatal: Crash sending disabled: ${FIND} not found."
+ exit 1
+ fi
+
TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)"
trap cleanup_tmp_dir EXIT INT
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698