summaryrefslogtreecommitdiff
path: root/usr/src/tools/scripts/hdrchk.py
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2019-01-11 13:16:51 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2019-01-11 13:16:51 +0000
commit882fee1ee6c160a1c4cb56a4874b0039ff1410c0 (patch)
treeadd61009c9f1e3c5849055eedf68b1ad9a8b7d97 /usr/src/tools/scripts/hdrchk.py
parentb7e394a4a3da3fcdb717314a5ebcd7a5f14def92 (diff)
parent247b7da039fd88350c50e3d7fef15bdab6bef215 (diff)
downloadillumos-joyent-882fee1ee6c160a1c4cb56a4874b0039ff1410c0.tar.gz
[illumos-gate merge]
commit 247b7da039fd88350c50e3d7fef15bdab6bef215 10205 Mounting zfs filesystems on startup shows incorrect data commit b928ac841f6012f92d5aedbd7dfacf443921fee3 10182 dd: print scaled stats commit c65ebfc7045424bd04a6c7719a27b0ad3399ad54 8886 mdns: update to mDNSResponder-878.1.1 commit 35786f6866ae52207d0f1a25fe7ca5f652f32ce0 9823 Deadlock in ACPI Method Evaluation 9824 Update ACPI to joyent/20180629 commit bc36eafdde0c7048471866fc7cea7b93852592db 9822 want iasl commit b75e7d76519aa3dc2e72aa357a039a6b65372a1c 9821 want a way to run vendor-specific commands via libscsi commit 2a613b5974ae49c8b068a3998ff554f8c6f0f593 9747 Implement CPU autoreplace based on Intel PPIN commit ca13eaa51ee900abba73dfb6624e492f7e48863e 9979 Support python3 for in-gate tools Conflicts: usr/src/uts/intel/sys/x86_archext.h usr/src/uts/i86pc/os/cmi_hw.c usr/src/tools/onbld/Checks/DbLookups.py usr/src/lib/fm/topo/modules/i86pc/chip/chip_subr.c
Diffstat (limited to 'usr/src/tools/scripts/hdrchk.py')
-rw-r--r--usr/src/tools/scripts/hdrchk.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr/src/tools/scripts/hdrchk.py b/usr/src/tools/scripts/hdrchk.py
index 8c529b8c3d..8f31899623 100644
--- a/usr/src/tools/scripts/hdrchk.py
+++ b/usr/src/tools/scripts/hdrchk.py
@@ -1,4 +1,4 @@
-#!@PYTHON@
+#!@TOOLS_PYTHON@
#
# CDDL HEADER START
#
@@ -22,13 +22,14 @@
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
#
#
# Check header files conform to ON standards.
#
-import sys, os, getopt
+import sys, os, io, getopt
sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib",
"python%d.%d" % sys.version_info[:2]))
@@ -59,11 +60,10 @@ for opt, arg in opts:
ret = 0
for filename in args:
try:
- fh = open(filename, 'r')
- except IOError, e:
+ with io.open(filename, encoding='utf-8',
+ errors='replace') as fh:
+ ret |= hdrchk(fh, lenient=lenient, output=sys.stderr)
+ except IOError as e:
sys.stderr.write("failed to open '%s': %s\n" %
(e.filename, e.strerror))
- else:
- ret |= hdrchk(fh, lenient=lenient, output=sys.stderr)
- fh.close()
sys.exit(ret)