1 |
vapier 13/12/02 05:35:17 |
2 |
|
3 |
Added: nbd-3.5-gznbd-printf-u64.patch |
4 |
nbd-3.5-gznbd-zlib.patch |
5 |
Log: |
6 |
Version bump #493010 by Agostino Sarubbo. |
7 |
|
8 |
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key FB7C4156) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 sys-block/nbd/files/nbd-3.5-gznbd-printf-u64.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/nbd/files/nbd-3.5-gznbd-printf-u64.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/nbd/files/nbd-3.5-gznbd-printf-u64.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: nbd-3.5-gznbd-printf-u64.patch |
17 |
=================================================================== |
18 |
From 90024f17b682e20a34f35a6ccb437edc10eb5c3b Mon Sep 17 00:00:00 2001 |
19 |
From: Mike Frysinger <vapier@g.o> |
20 |
Date: Mon, 2 Dec 2013 00:22:46 -0500 |
21 |
Subject: [PATCH 1/2] gznbd: use PRId64 for printing 64bit types |
22 |
|
23 |
Gcc complains about printing these 64bit types: |
24 |
|
25 |
gznbd.c:199:1: warning: format '%Ld' expects argument of type 'long long int', |
26 |
but argument 5 has type 'u64' [-Wformat] |
27 |
|
28 |
Use the standard defines from inttypes.h to avoid this issue. |
29 |
|
30 |
Signed-off-by: Mike Frysinger <vapier@g.o> |
31 |
--- |
32 |
gznbd/gznbd.c | 7 ++++--- |
33 |
1 file changed, 4 insertions(+), 3 deletions(-) |
34 |
|
35 |
diff --git a/gznbd/gznbd.c b/gznbd/gznbd.c |
36 |
index 09f3d49..bb41156 100644 |
37 |
--- a/gznbd/gznbd.c |
38 |
+++ b/gznbd/gznbd.c |
39 |
@@ -40,6 +40,7 @@ |
40 |
#include <fcntl.h> |
41 |
#include <syslog.h> |
42 |
#include <unistd.h> |
43 |
+#include <inttypes.h> |
44 |
|
45 |
#include <sys/ioctl.h> |
46 |
#include <sys/types.h> |
47 |
@@ -95,7 +96,7 @@ int main(int argc, char **argv) |
48 |
fprintf(stderr,"%s: %s does not appear to be a valid size\n",argv[0],argv[3]); |
49 |
exit(1); |
50 |
} |
51 |
- printf("%s: file=%s, size=%Ld\n",argv[0],argv[2],size); |
52 |
+ printf("%s: file=%s, size=%"PRId64"\n",argv[0],argv[2],size); |
53 |
} else { |
54 |
char buffer[BLOCK]; |
55 |
int result; |
56 |
@@ -110,7 +111,7 @@ int main(int argc, char **argv) |
57 |
} |
58 |
|
59 |
if(result==0){ |
60 |
- printf("size=%Ld\n",size); |
61 |
+ printf("size=%"PRId64"\n",size); |
62 |
} else { |
63 |
printf("failed\n"); |
64 |
if(result<0){ |
65 |
@@ -195,7 +196,7 @@ int main(int argc, char **argv) |
66 |
from=ntohll(request.from); |
67 |
|
68 |
#ifdef TRACE |
69 |
-fprintf(stderr,"%s: len=%d, from=%Ld\n",argv[0],len,from); |
70 |
+fprintf(stderr,"%s: len=%d, from=%"PRId64"\n",argv[0],len,from); |
71 |
#endif |
72 |
|
73 |
if(request.magic!=htonl(NBD_REQUEST_MAGIC)){ |
74 |
-- |
75 |
1.8.4.3 |
76 |
|
77 |
|
78 |
|
79 |
|
80 |
1.1 sys-block/nbd/files/nbd-3.5-gznbd-zlib.patch |
81 |
|
82 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/nbd/files/nbd-3.5-gznbd-zlib.patch?rev=1.1&view=markup |
83 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/nbd/files/nbd-3.5-gznbd-zlib.patch?rev=1.1&content-type=text/plain |
84 |
|
85 |
Index: nbd-3.5-gznbd-zlib.patch |
86 |
=================================================================== |
87 |
From 172a5a7c5824237537051247f203a39cc39e3aef Mon Sep 17 00:00:00 2001 |
88 |
From: Mike Frysinger <vapier@g.o> |
89 |
Date: Mon, 2 Dec 2013 00:24:01 -0500 |
90 |
Subject: [PATCH 2/2] gznbd: fix warning with newer zlib |
91 |
|
92 |
When you build against newer zlib, you get a lot of warnings like so: |
93 |
|
94 |
gznbd.c: In function 'main': |
95 |
gznbd.c:87:5: warning: assignment from incompatible pointer type [enabled by default] |
96 |
gznbd.c:109:5: warning: passing argument 1 of 'gzread' from incompatible pointer type [enabled by default] |
97 |
In file included from gznbd.c:37:0: |
98 |
/usr/include/zlib.h:1313:21: note: expected 'gzFile' but argument is of type 'struct gzFile_s **' |
99 |
gznbd.c:118:9: warning: passing argument 1 of 'gzerror' from incompatible pointer type [enabled by default] |
100 |
|
101 |
This is because the zlib API uses just gzFile everywhere, not a pointer |
102 |
to a gzFile. |
103 |
|
104 |
Signed-off-by: Mike Frysinger <vapier@g.o> |
105 |
--- |
106 |
gznbd/gznbd.c | 2 +- |
107 |
1 file changed, 1 insertion(+), 1 deletion(-) |
108 |
|
109 |
diff --git a/gznbd/gznbd.c b/gznbd/gznbd.c |
110 |
index bb41156..803c1c1 100644 |
111 |
--- a/gznbd/gznbd.c |
112 |
+++ b/gznbd/gznbd.c |
113 |
@@ -68,7 +68,7 @@ int main(int argc, char **argv) |
114 |
int pr[2]; |
115 |
int sk; |
116 |
int nbd; |
117 |
- gzFile *gz; |
118 |
+ gzFile gz; |
119 |
int gzerr; |
120 |
|
121 |
char chunk[CHUNK]; |
122 |
-- |
123 |
1.8.4.3 |