summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2022-01-21 14:09:16 +0100
committerMartin Mares <mj@ucw.cz>2022-01-21 14:09:16 +0100
commiteeef8fed3e6bd34c553ee8cb16d5fc1b703120af (patch)
tree8b1b7152e5a2c8de215dc434d987ecce37b030dc
parent884a163407cbc179b694294771a016071a6b6dd3 (diff)
downloadpciutils-eeef8fed3e6bd34c553ee8cb16d5fc1b703120af.tar.gz
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.
-rw-r--r--lib/init.c2
-rw-r--r--lib/pci.h2
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 */