diff --git a/ChangeLog b/ChangeLog index b3b96431..cbea0d2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-02-27 Joerg Wunsch + + * usb_libusb.c (usbdev_open): Replace all calls to exit(1) by + return -1 + 2014-02-26 Joerg Wunsch * jtag3_private.h: Add EDBG/CMSIS-DAP specific constants. diff --git a/usb_libusb.c b/usb_libusb.c index 4e37be0e..602d9a8e 100644 --- a/usb_libusb.c +++ b/usb_libusb.c @@ -100,7 +100,7 @@ static int usbdev_open(char * port, union pinfo pinfo, union filedescriptor *fd) fprintf(stderr, "%s: usbdev_open(): invalid serial number \"%s\"\n", progname, serno); - exit(1); + return -1; } } @@ -138,7 +138,7 @@ static int usbdev_open(char * port, union pinfo pinfo, union filedescriptor *fd) * continue anyway. */ if (serno != NULL) - exit(1); /* no chance */ + return -1; /* no chance */ else strcpy(string, "[unknown]"); } @@ -312,7 +312,7 @@ static int usbdev_open(char * port, union pinfo pinfo, union filedescriptor *fd) fprintf(stderr, "%s: usbdev_open(): did not find any%s USB device \"%s\"\n", progname, serno? " (matching)": "", port); - exit(1); + return -1; } static void usbdev_close(union filedescriptor *fd)