Fri Jun 14 01:07:58 2013 UTC ()
patch-ab modified to fix clang build problem:
  (1) clang flags:
  dd_rescue.c:1494:22: warning: implicit declaration of function 'basename' is invalid in C99 [-Wimplicit-function-declaration]
        const char* ibase = basename(inm);
  (3) clang flags:
  dd_recue.c:(.text+0x12b4): undefined reference to `mypread'
  dd_rescue.c:(.text+0x1374): undefined reference to `mypwrite'
Reported by joerg@ bulkbuild, and discussed on tech-pkg@, thanks.


(mef)
diff -r1.7 -r1.8 pkgsrc/sysutils/dd_rescue/distinfo
diff -r1.6 -r1.7 pkgsrc/sysutils/dd_rescue/patches/patch-ab

cvs diff -r1.7 -r1.8 pkgsrc/sysutils/dd_rescue/distinfo (expand / switch to unified diff)

--- pkgsrc/sysutils/dd_rescue/distinfo 2013/06/04 00:47:46 1.7
+++ pkgsrc/sysutils/dd_rescue/distinfo 2013/06/14 01:07:58 1.8
@@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
1$NetBSD: distinfo,v 1.7 2013/06/04 00:47:46 mef Exp $ 1$NetBSD: distinfo,v 1.8 2013/06/14 01:07:58 mef Exp $
2 2
3SHA1 (dd_rescue-1.33.tar.gz) = cb21524fec919d32b7263b7999e2c8b26e7273cd 3SHA1 (dd_rescue-1.33.tar.gz) = cb21524fec919d32b7263b7999e2c8b26e7273cd
4RMD160 (dd_rescue-1.33.tar.gz) = ed39efddcf3fa6708926cb31c9b32020e0d59208 4RMD160 (dd_rescue-1.33.tar.gz) = ed39efddcf3fa6708926cb31c9b32020e0d59208
5Size (dd_rescue-1.33.tar.gz) = 36923 bytes 5Size (dd_rescue-1.33.tar.gz) = 36923 bytes
6SHA1 (patch-aa) = ae11e96371b3b815b066a2dcedd869c90d4b89ff 6SHA1 (patch-aa) = ae11e96371b3b815b066a2dcedd869c90d4b89ff
7SHA1 (patch-ab) = 4ff83cbe0528f8d3db0c0af4d1e135ebad055561 7SHA1 (patch-ab) = b590da5113cf4367b52d2042f036acbe6e330fbe
8SHA1 (patch-frandom_c) = dd3c300df7a2f6cee6c981507c1dd17b39c47fb2 8SHA1 (patch-frandom_c) = dd3c300df7a2f6cee6c981507c1dd17b39c47fb2

cvs diff -r1.6 -r1.7 pkgsrc/sysutils/dd_rescue/patches/patch-ab (expand / switch to unified diff)

--- pkgsrc/sysutils/dd_rescue/patches/patch-ab 2013/06/04 00:47:46 1.6
+++ pkgsrc/sysutils/dd_rescue/patches/patch-ab 2013/06/14 01:07:58 1.7
@@ -1,30 +1,64 @@ @@ -1,30 +1,64 @@
1$NetBSD: patch-ab,v 1.6 2013/06/04 00:47:46 mef Exp $ 1$NetBSD: patch-ab,v 1.7 2013/06/14 01:07:58 mef Exp $
2 2
 3(1) clang flags:
 4dd_rescue.c:1494:22: warning: implicit declaration of function 'basename' is invalid in C99 [-Wimplicit-function-declaration]
 5 const char* ibase = basename(inm);
 6(2)
3See http://gnats.netbsd.org/38620 7See http://gnats.netbsd.org/38620
4dd_rescue: (fatal): allocation of aligned buffer failed! 8dd_rescue: (fatal): allocation of aligned buffer failed!
5 9
 10(3) clang flags:
 11dd_recue.c:(.text+0x12b4): undefined reference to `mypread'
 12dd_rescue.c:(.text+0x1374): undefined reference to `mypwrite'
 13
6--- dd_rescue.c.orig 2013-03-31 04:24:34.000000000 +0900 14--- dd_rescue.c.orig 2013-03-31 04:24:34.000000000 +0900
7+++ dd_rescue.c 2013-04-08 17:03:27.000000000 +0900 15+++ dd_rescue.c 2013-06-13 16:44:35.000000000 +0900
8@@ -121,6 +121,10 @@ _syscall6(long, splice, int, fdin, loff_ 16@@ -83,6 +83,7 @@
 17 #include <limits.h>
 18 #include <sys/time.h>
 19 #include <sys/stat.h>
 20+#include <libgen.h>
 21
 22 #include "frandom.h"
 23 #include "list.h"
 24@@ -121,6 +122,10 @@
9 # endif 25 # endif
10 #endif 26 #endif
11  27
12+#ifdef __DragonFly__ 28+#ifdef __DragonFly__
13+#undef O_DIRECT 29+#undef O_DIRECT
14+#endif 30+#endif
15+ 31+
16 /* fwd decls */ 32 /* fwd decls */
17 int cleanup(); 33 int cleanup();
18  34
19@@ -1452,6 +1456,11 @@ unsigned char* zalloc_buf(unsigned int b 35@@ -740,7 +745,7 @@
 36 return ln;
 37 }
 38
 39-inline ssize_t mypread(int fd, void* bf, size_t sz, off_t off)
 40+static inline ssize_t mypread(int fd, void* bf, size_t sz, off_t off)
 41 {
 42 if (i_repeat) {
 43 if (i_rep_init)
 44@@ -762,7 +767,7 @@
 45 return pread(fd, bf, sz, off);
 46 }
 47
 48-inline ssize_t mypwrite(int fd, void* bf, size_t sz, off_t off)
 49+static inline ssize_t mypwrite(int fd, void* bf, size_t sz, off_t off)
 50 {
 51 if (o_chr)
 52 return write(fd, bf, sz);
 53@@ -1452,6 +1457,11 @@
20 unsigned char *ptr; 54 unsigned char *ptr;
21 #ifdef O_DIRECT 55 #ifdef O_DIRECT
22 void *mp; 56 void *mp;
23+#ifdef linux 57+#ifdef linux
24+#define my_valloc(a, b, c) posix_memalign((a), (b), (c)) 58+#define my_valloc(a, b, c) posix_memalign((a), (b), (c))
25+#else 59+#else
26+#define my_valloc(a, b, c) !(*(a) = valloc((c))) 60+#define my_valloc(a, b, c) !(*(a) = valloc((c)))
27+#endif 61+#endif
28 if (posix_memalign(&mp, pagesize, bs)) { 62 if (posix_memalign(&mp, pagesize, bs)) {
29 fplog(stderr, "dd_rescue: (fatal): allocation of aligned buffer failed!\n"); 63 fplog(stderr, "dd_rescue: (fatal): allocation of aligned buffer failed!\n");
30 cleanup(); exit(18); 64 cleanup(); exit(18);