diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-01-12 17:01:32 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-01-12 17:01:32 +0000 |
commit | 260a194ef29de6abaadd50668b584101489aaf64 (patch) | |
tree | 62a6f2ebccb33186ee76165600d55fcdf96993b5 /usr.sbin/acpidump | |
parent | f265cc55f4ee80b06e3ea771b0b9e1193bb645cc (diff) |
Add -q flag to suppress the message that ACPI information can't be found.
ok deraadt@
Diffstat (limited to 'usr.sbin/acpidump')
-rw-r--r-- | usr.sbin/acpidump/acpidump.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/acpidump/acpidump.c b/usr.sbin/acpidump/acpidump.c index 507f05181e0..18c0e6d1382 100644 --- a/usr.sbin/acpidump/acpidump.c +++ b/usr.sbin/acpidump/acpidump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidump.c,v 1.21 2018/08/08 18:46:04 deraadt Exp $ */ +/* $OpenBSD: acpidump.c,v 1.22 2019/01/12 17:01:31 kettenis Exp $ */ /* * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org> * All rights reserved. @@ -174,6 +174,7 @@ int acpi_mem_fd = -1; char *aml_dumpfile; int aml_dumpdir; FILE *fhdr; +int quiet; int acpi_checksum(void *_p, size_t _length); struct acpi_user_mapping *acpi_user_find_mapping(vm_offset_t _pa, size_t _size); @@ -628,8 +629,11 @@ asl_dump_from_devmem(void) err(1, "pledge"); rp = acpi_find_rsd_ptr(); - if (!rp) - errx(1, "Can't find ACPI information"); + if (!rp) { + if (!quiet) + warnx("Can't find ACPI information"); + exit(1); + } fhdr = fopen(name, "w"); if (fhdr == NULL) @@ -670,11 +674,14 @@ main(int argc, char *argv[]) struct stat st; int c; - while ((c = getopt(argc, argv, "o:")) != -1) { + while ((c = getopt(argc, argv, "o:q")) != -1) { switch (c) { case 'o': aml_dumpfile = optarg; break; + case 'q': + quiet = 1; + break; default: usage(); break; |