aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/pilot-link/patches/fix-unused_result.patch
blob: 4e4f30abaccca4fa1915773342bc89705cc36d7f (plain) (blame)
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
--- a/libpisock/serial.c	2006-10-12 16:21:22.000000000 +0200
+++ b/libpisock/serial.c	2016-12-20 14:38:46.477854828 +0100
@@ -364,6 +364,7 @@
 begin:
 	if ((err = data->impl.open(ps, pa, addrlen)) < 0) {
 		int 	save_errno = errno;
+		char* 	result = NULL;
 #ifdef MAXPATHLEN
 		char	realport[MAXPATHLEN];
 #else
@@ -374,8 +375,10 @@
  # endif /* PATH_MAX */
 #endif /* MAXPATHLEN */
 
-		realpath(pa->pi_device, realport);
+		result = realpath(pa->pi_device, realport);
 		errno = save_errno;
+		if (result == NULL)
+			result == realport;
 
 		if (errno == ENOENT) {
 			LOG((PI_DBG_DEV, PI_DBG_LVL_ERR,
--- a/src/pilot-foto-treo600.c	2009-06-04 15:32:30.000000000 +0200
+++ b/src/pilot-foto-treo600.c	2016-12-20 15:24:35.897251325 +0100
@@ -86,8 +86,14 @@
 		}
 
 		if (req_uid && uid == req_uid) {
-			memcpy(&req_uid, Pbuf, 4);	/* get next req_uid for image 'block' */
-			write(fd, Pbuf + 4, size - 4);	/* The rest is just jpeg data */
+			size_t done;
+			memcpy(&req_uid, Pbuf, 4);		/* get next req_uid for image 'block' */
+			done = write(fd, Pbuf + 4, size - 4);	/* The rest is just jpeg data */
+			if (done != size - 4) {
+				fprintf(stderr,"   ERROR: Error writing '%s' size %d\n\n",
+					imgfilename, size - 4);
+				return -1;
+			}
 		}
 	}