From de65af7dfd6ea18cef10245dce7459de17c2f958 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 8 Jan 2008 17:36:20 +0000 Subject: - monitor-parse-edid: ": bad edid" so that monitor-edid trying to parse "" /proc/acpi/video/**/EDID files will give a more understandable error message --- NEWS | 3 +++ monitor-parse-edid | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 NEWS diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..378d633 --- /dev/null +++ b/NEWS @@ -0,0 +1,3 @@ +- monitor-parse-edid: ": bad edid" so that monitor-edid trying to + parse "" /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)) { -- cgit v1.2.1