integ/base/pf-bb-config/debian/patches/0001-Fix-check-return-of-co...

38 lines
1.0 KiB
Diff

From b1b29494ab8b9395c36c1b5664af324c7f67245c Mon Sep 17 00:00:00 2001
From: Andre Kantek <andrefernandozanella.kantek@windriver.com>
Date: Wed, 23 Nov 2022 08:36:08 -0300
Subject: [PATCH] Fix: check return of configure_device()
Takes the result of configure_device() as the return code of the
application, allowing any script running pf-bb-config to stop on
bad device configuration.
Signed-off-by: Andre Kantek <andrefernandozanella.kantek@windriver.com>
---
config_app.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/config_app.c b/config_app.c
index 4f72764..066fb55 100644
--- a/config_app.c
+++ b/config_app.c
@@ -431,11 +431,15 @@ main(int argc, char *argv[])
return -1;
}
+ ret = 0;
if (device.config_all) {
for (i = 0; i < num_devices; i++) {
strncpy(device.pci_address, found_devices[i],
sizeof(device.pci_address) - NULL_PAD);
ret = configure_device(&device);
+ if (ret != 0) {
+ break;
+ }
}
} else {
select_device(&device, found_devices, num_devices);
--
2.17.1