From eeef8fed3e6bd34c553ee8cb16d5fc1b703120af Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 21 Jan 2022 14:09:16 +0100 Subject: [PATCH] pci.h: The error callback is now declared with PCI_NONRET Users of the repeatedly complain that the library crashes, which is usually caused by providing an error hook which returns to the library. Let's try warning them more explicitly. --- lib/init.c | 2 +- lib/pci.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/init.c b/lib/init.c index caa57ec..e8bc937 100644 --- a/lib/init.c +++ b/lib/init.c @@ -96,7 +96,7 @@ static int probe_sequence[] = { -1, }; -static void +static void PCI_NONRET pci_generic_error(char *msg, ...) { va_list args; diff --git a/lib/pci.h b/lib/pci.h index 8142476..328a468 100644 --- a/lib/pci.h +++ b/lib/pci.h @@ -62,7 +62,7 @@ struct pci_access { int debugging; /* Turn on debugging messages */ /* Functions you can override: */ - void (*error)(char *msg, ...) PCI_PRINTF(1,2); /* Write error message and quit */ + void (*error)(char *msg, ...) PCI_PRINTF(1,2) PCI_NONRET; /* Write error message and quit */ void (*warning)(char *msg, ...) PCI_PRINTF(1,2); /* Write a warning message */ void (*debug)(char *msg, ...) PCI_PRINTF(1,2); /* Write a debugging message */ -- 2.39.5