1 abort() is a C library function and used by Jim, so it results in
2 a duplicate definition and confusion when linking statically.
4 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
6 diff -Nura usb-modeswitch-2.2.5.orig/usb_modeswitch.c usb-modeswitch-2.2.5/usb_modeswitch.c
7 --- usb-modeswitch-2.2.5.orig/usb_modeswitch.c 2015-07-28 08:24:41.043352748 -0300
8 +++ usb-modeswitch-2.2.5/usb_modeswitch.c 2015-07-28 08:38:43.557315576 -0300
10 libusb_open(dev, &devh);
12 SHOW_PROGRESS(output,"Error opening the device. Abort\n\n");
19 ResponseEndpoint = find_first_bulk_endpoint(LIBUSB_ENDPOINT_IN);
20 if (!MessageEndpoint) {
21 fprintf(stderr,"Error: message endpoint not given or found. Abort\n\n");
25 if (!ResponseEndpoint) {
26 fprintf(stderr,"Error: response endpoint not given or found. Abort\n\n");
30 SHOW_PROGRESS(output,"Use endpoints 0x%02x (out) and 0x%02x (in)\n", MessageEndpoint, ResponseEndpoint);
33 if (interfaceClass == -1) {
34 fprintf(stderr, "Error: Could not get class of interface %d. Does it exist? Abort\n\n",Interface);
39 if (defaultClass == 0)
41 if (defaultClass != 8) {
42 fprintf(stderr, "Error: can't use storage command in MessageContent with interface %d;\n"
43 " interface class is %d, expected 8. Abort\n\n", Interface, defaultClass);
48 if (InquireDevice && show_progress) {
51 if ( ModeMap & (ModeMap-1) ) {
52 fprintf(output,"Multiple special modes selected; check configuration. Abort\n\n");
57 if ((strlen(MessageContent) || StandardEject) && ModeMap ) {
59 ret = libusb_claim_interface(devh, Interface);
61 SHOW_PROGRESS(output," Could not claim interface (error %d). Abort\n", ret);
65 // libusb_clear_halt(devh, MessageEndpoint);
68 int ret = libusb_get_active_config_descriptor(dev, &active_config);
70 SHOW_PROGRESS(output," Determining the active configuration failed (error %d). Abort\n", ret);
74 return active_config->bConfigurationValue;
79 fprintf(stderr, "Error: Could not find file %s. Abort\n\n", FileName);
83 token = fgets(Str, LINE_DIM-1, file);
94 diff -Nura usb-modeswitch-2.2.5.orig/usb_modeswitch.h usb-modeswitch-2.2.5/usb_modeswitch.h
95 --- usb-modeswitch-2.2.5.orig/usb_modeswitch.h 2015-07-28 08:24:41.043352748 -0300
96 +++ usb-modeswitch-2.2.5/usb_modeswitch.h 2015-07-28 08:38:54.986708480 -0300
103 int readArguments(int argc, char **argv);
104 void deviceDescription();