aboutsummaryrefslogtreecommitdiff
path: root/package/usb_modeswitch/0001-rename-abort.patch
blob: 739e817c6366c59338ae26ac223221b03ddab463 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
abort() is a C library function and used by Jim, so it results in
a duplicate definition and confusion when linking statically.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

diff -Nura usb-modeswitch-2.2.5.orig/usb_modeswitch.c usb-modeswitch-2.2.5/usb_modeswitch.c
--- usb-modeswitch-2.2.5.orig/usb_modeswitch.c	2015-07-28 08:24:41.043352748 -0300
+++ usb-modeswitch-2.2.5/usb_modeswitch.c	2015-07-28 08:38:43.557315576 -0300
@@ -544,7 +544,7 @@
 		libusb_open(dev, &devh);
 		if (devh == NULL) {
 			SHOW_PROGRESS(output,"Error opening the device. Abort\n\n");
-			abort();
+			abortOut();
 		}
 	}
 
@@ -574,18 +574,18 @@
 			ResponseEndpoint = find_first_bulk_endpoint(LIBUSB_ENDPOINT_IN);
 		if (!MessageEndpoint) {
 			fprintf(stderr,"Error: message endpoint not given or found. Abort\n\n");
-			abort();
+			abortOut();
 		}
 		if (!ResponseEndpoint) {
 			fprintf(stderr,"Error: response endpoint not given or found. Abort\n\n");
-			abort();
+			abortOut();
 		}
 		SHOW_PROGRESS(output,"Use endpoints 0x%02x (out) and 0x%02x (in)\n", MessageEndpoint, ResponseEndpoint);
 	}
 
 	if (interfaceClass == -1) {
 		fprintf(stderr, "Error: Could not get class of interface %d. Does it exist? Abort\n\n",Interface);
-		abort();
+		abortOut();
 	}
 
 	if (defaultClass == 0)
@@ -601,7 +601,7 @@
 		if (defaultClass != 8) {
 			fprintf(stderr, "Error: can't use storage command in MessageContent with interface %d;\n"
 				"       interface class is %d, expected 8. Abort\n\n", Interface, defaultClass);
-			abort();
+			abortOut();
 		}
 
 	if (InquireDevice && show_progress) {
@@ -629,7 +629,7 @@
 	 */
 	if ( ModeMap & (ModeMap-1) ) {
 		fprintf(output,"Multiple special modes selected; check configuration. Abort\n\n");
-		abort();
+		abortOut();
 	}
 
 	if ((strlen(MessageContent) || StandardEject) && ModeMap ) {
@@ -1339,7 +1339,7 @@
 	ret = libusb_claim_interface(devh, Interface);
 	if (ret < 0) {
 		SHOW_PROGRESS(output," Could not claim interface (error %d). Abort\n", ret);
-		abort();
+		abortOut();
 	}
 //	libusb_clear_halt(devh, MessageEndpoint);
 	if (show_progress)
@@ -1832,7 +1832,7 @@
 	int ret = libusb_get_active_config_descriptor(dev, &active_config);
 	if (ret < 0) {
 		SHOW_PROGRESS(output," Determining the active configuration failed (error %d). Abort\n", ret);
-		abort();
+		abortOut();
 	}
 	return active_config->bConfigurationValue;
 }
@@ -1878,7 +1878,7 @@
 			}
 			if (file==NULL) {
 				fprintf(stderr, "Error: Could not find file %s. Abort\n\n", FileName);
-				abort();
+				abortOut();
 			} else {
 				token = fgets(Str, LINE_DIM-1, file);
 			}
@@ -2014,7 +2014,7 @@
 		closelog();
 }
 
-void abort()
+void abortOut()
 {
 	close_all();
 	exit(1);
diff -Nura usb-modeswitch-2.2.5.orig/usb_modeswitch.h usb-modeswitch-2.2.5/usb_modeswitch.h
--- usb-modeswitch-2.2.5.orig/usb_modeswitch.h	2015-07-28 08:24:41.043352748 -0300
+++ usb-modeswitch-2.2.5/usb_modeswitch.h	2015-07-28 08:38:54.986708480 -0300
@@ -61,7 +61,7 @@
 void printVersion();
 void printHelp();
 void close_all();
-void abort();
+void abortOut();
 int readArguments(int argc, char **argv);
 void deviceDescription();
 int deviceInquire();