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

Unified Diff: build/linux/dump_signature.py

Issue 126062: Cleanups from post-submit suggestions. (Closed)
Patch Set: more cleanups Created 11 years, 6 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 | « build/linux/dump_app_syms ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/linux/dump_signature.py
diff --git a/build/linux/dump_signature.py b/build/linux/dump_signature.py
index 779bf85b8e49a5d21f86ba9ddd8d12e8a6446043..2814498b8967555679336a2ea60e88b4cfcc8bc6 100755
--- a/build/linux/dump_signature.py
+++ b/build/linux/dump_signature.py
@@ -8,6 +8,7 @@
# src/breakpad/linux/minidump_writer.cc@17081
import sys
+import struct
if len(sys.argv) != 2:
sys.stderr.write("Error, no filename specified.\n")
@@ -17,15 +18,13 @@ bin = open(sys.argv[1])
data = bin.read(4096)
if len(data) != 4096:
sys.stderr.write("Error, did not read first page of data.\n");
+ sys.exit(1)
bin.close()
signature = [0] * 16
for i in range(0, 4096):
signature[i % 16] ^= ord(data[i])
-out = ''
-# Assume we're running on little endian
-for i in [3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15]:
- out += '%02X' % signature[i]
-out += '0'
+out = ('%08x%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x0' %
+ struct.unpack('I2H8B',struct.pack('16B',*signature)))
Mark Mentovai 2009/06/12 19:12:28 Spaces after commas (you copied/pasted my style er
sys.stdout.write(out)
« no previous file with comments | « build/linux/dump_app_syms ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698