From bd4a9e3887010062474a368c8eee6f9e4ce012b4 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Mon, 20 Jun 2011 16:03:53 +0200 Subject: [PATCH] Clean up in error pathes --- examples/eeprom.c | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 deletions(-) diff --git a/examples/eeprom.c b/examples/eeprom.c index 1a11e3b..022cf03 100644 --- a/examples/eeprom.c +++ b/examples/eeprom.c @@ -26,6 +26,7 @@ int main(int argc, char **argv) int do_write = 0; int size; int value; + int retval = 0; if ((ftdi = ftdi_new()) == 0) { @@ -74,7 +75,8 @@ int main(int argc, char **argv) "product description\n"); fprintf(stderr, "\t-S type, value); @@ -222,10 +232,11 @@ int main(int argc, char **argv) { fprintf(stderr, "ftdi_eeprom_decode: %d (%s)\n", f, ftdi_get_error_string(ftdi)); - exit(-1); + retval = -1; } +done: ftdi_usb_close(ftdi); ftdi_free(ftdi); - return 0; + return retval; } -- 1.7.1