aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rwxr-xr-xmonitor-parse-edid8
2 files changed, 10 insertions, 1 deletions
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..378d633
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,3 @@
+- monitor-parse-edid: "<file name>: bad edid" so that monitor-edid trying to
+ parse "<not supported>" /proc/acpi/video/**/EDID files will give a more
+ understandable error message
diff --git a/monitor-parse-edid b/monitor-parse-edid
index c542fe4..f5bb960 100755
--- a/monitor-parse-edid
+++ b/monitor-parse-edid
@@ -462,7 +462,13 @@ if (@ARGV == 0) {
my $raw_edid = join('', <$F>);
-length($raw_edid) == 128 || length($raw_edid) == 256 or die "monitor-parse-edid: bad edid\n";
+sub error {
+ my ($msg) = @_;
+ print STDERR ($file ? "$file: " : ''), $msg, "\n";
+ exit 1;
+}
+
+length($raw_edid) == 128 || length($raw_edid) == 256 or error("bad edid");
my $edid = parse_edid($raw_edid);
if (my $err = check_parsed_edid($edid)) {