pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pbulk Use libnbcompat and fix build issues on...
details: https://anonhg.NetBSD.org/pkgsrc/rev/479728182e7b
branches: trunk
changeset: 530342:479728182e7b
user: joerg <joerg%pkgsrc.org@localhost>
date: Mon Jun 25 21:38:43 2007 +0000
description:
Use libnbcompat and fix build issues on Solaris.
Don't depend on sin_len. Slightly factor out code for setting
non-blocking IO.
Bump to pbulk-0.2. Tested by dmcmahill@.
diffstat:
pkgtools/pbulk/Makefile | 10 ++++++-
pkgtools/pbulk/files/pbulk/Makefile.inc | 4 ++-
pkgtools/pbulk/files/pbulk/lib/alloc.c | 12 ++++++----
pkgtools/pbulk/files/pbulk/lib/atomic.c | 14 ++++++-----
pkgtools/pbulk/files/pbulk/lib/event.c | 26 ++++++++++++++++++----
pkgtools/pbulk/files/pbulk/lib/exec.c | 12 ++++++---
pkgtools/pbulk/files/pbulk/lib/match.c | 18 ++++++++------
pkgtools/pbulk/files/pbulk/lib/netaddr.c | 10 ++++++--
pkgtools/pbulk/files/pbulk/lib/pbulk.h | 6 +++-
pkgtools/pbulk/files/pbulk/lib/read_child.c | 10 +++++---
pkgtools/pbulk/files/pbulk/lib/read_file.c | 14 ++++++-----
pkgtools/pbulk/files/pbulk/pbuild/client.c | 18 +++++++++------
pkgtools/pbulk/files/pbulk/pbuild/jobs.c | 18 ++++++++------
pkgtools/pbulk/files/pbulk/pbuild/master.c | 30 +++++++++++++++----------
pkgtools/pbulk/files/pbulk/pbuild/pbuild.c | 14 ++++++-----
pkgtools/pbulk/files/pbulk/pbuild/pbuild.h | 4 +-
pkgtools/pbulk/files/pbulk/pbuild/stat.c | 18 +++++++++------
pkgtools/pbulk/files/pbulk/presolve/presolve.c | 20 +++++++++-------
pkgtools/pbulk/files/pbulk/pscan/client.c | 18 +++++++++------
pkgtools/pbulk/files/pbulk/pscan/jobs.c | 14 ++++++-----
pkgtools/pbulk/files/pbulk/pscan/master.c | 30 +++++++++++++++----------
pkgtools/pbulk/files/pbulk/pscan/pscan.c | 19 +++++++++------
pkgtools/pbulk/files/pbulk/pscan/pscan.h | 4 ++-
23 files changed, 212 insertions(+), 131 deletions(-)
diffs (truncated from 790 to 300 lines):
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/Makefile
--- a/pkgtools/pbulk/Makefile Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/Makefile Mon Jun 25 21:38:43 2007 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2007/06/20 13:31:26 joerg Exp $
+# $NetBSD: Makefile,v 1.4 2007/06/25 21:38:43 joerg Exp $
-DISTNAME= pbulk-0.1
+DISTNAME= pbulk-0.2
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
@@ -55,5 +55,11 @@
. endif
.endif
+.if ${OPSYS} == "SunOS"
+LDADD+= -lsocket -lresolv
+MAKE_ENV+= LDADD=${LDADD:Q}
+.endif
+
.include "../../devel/libevent/buildlink3.mk"
+.include "../../pkgtools/libnbcompat/inplace.mk"
.include "../../mk/bsd.pkg.mk"
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/Makefile.inc
--- a/pkgtools/pbulk/files/pbulk/Makefile.inc Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/Makefile.inc Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1.1.1 2007/06/19 19:49:55 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.2 2007/06/25 21:38:43 joerg Exp $
BINDIR?= ${PREFIX}/bin
@@ -16,3 +16,5 @@
LDADD+= -levent
.endif
.endif
+
+LDADD+= -lnbcompat
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/alloc.c
--- a/pkgtools/pbulk/files/pbulk/lib/alloc.c Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/alloc.c Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: alloc.c,v 1.1.1.1 2007/06/19 19:49:58 joerg Exp $ */
+/* $NetBSD: alloc.c,v 1.2 2007/06/25 21:38:43 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -31,11 +31,13 @@
* SUCH DAMAGE.
*/
-#include <err.h>
+#include <nbcompat.h>
+
+#include <nbcompat/err.h>
#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <nbcompat/stdio.h>
+#include <nbcompat/stdlib.h>
+#include <nbcompat/string.h>
#include "pbulk.h"
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/atomic.c
--- a/pkgtools/pbulk/files/pbulk/lib/atomic.c Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/atomic.c Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic.c,v 1.1.1.1 2007/06/19 19:49:59 joerg Exp $ */
+/* $NetBSD: atomic.c,v 1.2 2007/06/25 21:38:43 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -31,12 +31,14 @@
* SUCH DAMAGE.
*/
-#include <sys/stat.h>
-#include <err.h>
+#include <nbcompat.h>
+
+#include <nbcompat/stat.h>
+#include <nbcompat/err.h>
#include <fcntl.h>
-#include <limits.h>
-#include <string.h>
-#include <unistd.h>
+#include <nbcompat/limits.h>
+#include <nbcompat/string.h>
+#include <nbcompat/unistd.h>
#include "pbulk.h"
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/event.c
--- a/pkgtools/pbulk/files/pbulk/lib/event.c Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/event.c Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: event.c,v 1.2 2007/06/19 20:42:49 joerg Exp $ */
+/* $NetBSD: event.c,v 1.3 2007/06/25 21:38:44 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -31,12 +31,17 @@
* SUCH DAMAGE.
*/
-#include <sys/types.h>
+#include <nbcompat.h>
+
+#include <nbcompat/types.h>
#include <sys/ioctl.h>
-#include <sys/time.h>
+#ifdef __sun
+#include <sys/filio.h>
+#endif
+#include <nbcompat/time.h>
#include <event.h>
-#include <stdlib.h>
-#include <unistd.h>
+#include <nbcompat/stdlib.h>
+#include <nbcompat/unistd.h>
#include "pbulk.h"
@@ -145,3 +150,14 @@
deferred_write_handler, data);
event_add(&data->ev, NULL);
}
+
+int
+set_nonblocking(int fd)
+{
+ int ioctl_arg;
+
+ ioctl_arg = 1;
+ if (ioctl(fd, FIONBIO, &ioctl_arg) == -1)
+ return -1;
+ return 0;
+}
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/exec.c
--- a/pkgtools/pbulk/files/pbulk/lib/exec.c Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/exec.c Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.1.1.1 2007/06/19 19:49:58 joerg Exp $ */
+/* $NetBSD: exec.c,v 1.2 2007/06/25 21:38:44 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -31,10 +31,14 @@
* SUCH DAMAGE.
*/
-#include <err.h>
+#include <nbcompat.h>
+
+#include <nbcompat/err.h>
+#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
-#include <string.h>
-#include <unistd.h>
+#endif
+#include <nbcompat/string.h>
+#include <nbcompat/unistd.h>
#include "pbulk.h"
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/match.c
--- a/pkgtools/pbulk/files/pbulk/lib/match.c Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/match.c Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: match.c,v 1.1.1.1 2007/06/19 19:49:59 joerg Exp $ */
+/* $NetBSD: match.c,v 1.2 2007/06/25 21:38:44 joerg Exp $ */
/*
* Copyright © 2002 Alistair G. Crooks. All rights reserved.
@@ -28,13 +28,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <ctype.h>
-#include <err.h>
-#include <fnmatch.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <nbcompat.h>
+
+#include <nbcompat/ctype.h>
+#include <nbcompat/err.h>
+#include <nbcompat/fnmatch.h>
+#include <nbcompat/limits.h>
+#include <nbcompat/stdlib.h>
+#include <nbcompat/stdio.h>
+#include <nbcompat/string.h>
#include "pbulk.h"
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/netaddr.c
--- a/pkgtools/pbulk/files/pbulk/lib/netaddr.c Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/netaddr.c Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netaddr.c,v 1.1.1.1 2007/06/19 19:49:58 joerg Exp $ */
+/* $NetBSD: netaddr.c,v 1.2 2007/06/25 21:38:44 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -31,12 +31,14 @@
* SUCH DAMAGE.
*/
+#include <nbcompat.h>
+
#include <sys/socket.h>
#include <arpa/inet.h>
#include <errno.h>
#include <netinet/in.h>
-#include <stdlib.h>
-#include <string.h>
+#include <nbcompat/stdlib.h>
+#include <nbcompat/string.h>
#include "pbulk.h"
@@ -68,7 +70,9 @@
return -1;
addr->sin_port = htons((in_port_t)tmp);
addr->sin_addr = in;
+#if !defined(__sun)
addr->sin_len = sizeof(*addr);
+#endif
addr->sin_family = AF_INET;
return 0;
}
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/pbulk.h
--- a/pkgtools/pbulk/files/pbulk/lib/pbulk.h Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/pbulk.h Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pbulk.h,v 1.1.1.1 2007/06/19 19:49:58 joerg Exp $ */
+/* $NetBSD: pbulk.h,v 1.2 2007/06/25 21:38:44 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -32,7 +32,7 @@
*/
#include <netinet/in.h>
-#include <unistd.h>
+#include <nbcompat/unistd.h>
#if defined(__GNUC__) && __GNUC__ >= 2
char *xasprintf(const char *, ...)
@@ -41,6 +41,8 @@
char *xasprintf(const char *, ...);
#endif
+int set_nonblocking(int);
+
void deferred_read(int fd, void *, size_t, void *,
void (*)(void *), void (*)(void *));
void deferred_write(int fd, const void *, size_t,
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/read_child.c
--- a/pkgtools/pbulk/files/pbulk/lib/read_child.c Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/read_child.c Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: read_child.c,v 1.1.1.1 2007/06/19 19:49:58 joerg Exp $ */
+/* $NetBSD: read_child.c,v 1.2 2007/06/25 21:38:44 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -31,11 +31,13 @@
* SUCH DAMAGE.
*/
+#include <nbcompat.h>
+
#include <sys/wait.h>
-#include <err.h>
+#include <nbcompat/err.h>
#include <signal.h>
-#include <stdlib.h>
-#include <string.h>
+#include <nbcompat/stdlib.h>
+#include <nbcompat/string.h>
#include "pbulk.h"
diff -r 7f9644b0531f -r 479728182e7b pkgtools/pbulk/files/pbulk/lib/read_file.c
--- a/pkgtools/pbulk/files/pbulk/lib/read_file.c Mon Jun 25 21:36:18 2007 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/read_file.c Mon Jun 25 21:38:43 2007 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: read_file.c,v 1.1.1.1 2007/06/19 19:49:58 joerg Exp $ */
+/* $NetBSD: read_file.c,v 1.2 2007/06/25 21:38:44 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -31,12 +31,14 @@
* SUCH DAMAGE.
Home |
Main Index |
Thread Index |
Old Index