From: Jean-Jacques Hiblot Date: Thu, 20 Sep 2018 15:02:53 +0000 (+0200) Subject: tools: PCI: Exit with error code when test fails X-Git-Tag: v5.2-rc1~70^2~4^2~10 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=b71f0a0b1e3fea212a6a5042ced8b48a81738ac9;p=linux.git tools: PCI: Exit with error code when test fails This makes it easier to use pcitest in automated setups. Signed-off-by: Jean-Jacques Hiblot Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I --- diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index ec4d51f3308b..310a7e4850f6 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -140,6 +140,7 @@ static void run_test(struct pci_test *test) } fflush(stdout); + return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */ } int main(int argc, char **argv) @@ -228,6 +229,5 @@ int main(int argc, char **argv) return -EINVAL; } - run_test(test); - return 0; + return run_test(test); }