diff options
author | Maxim Sobolev <sobomax@FreeBSD.org> | 2001-10-29 08:19:24 +0000 |
---|---|---|
committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2001-10-29 08:19:24 +0000 |
commit | 128ab3ea692fd95d9f843bb4158cb7a5a865dff1 (patch) | |
tree | 5d47b869b3289261f8bcfc911abad5e0b6efab9c /devel/ORBit2/files/patch-src::IIOP::giop-msg-buffer.c | |
parent | Update to 0.12.6. (diff) |
Reimplement fix for an imcompatibility between ORBit and FreeBSD properly.
Instead of replacing writev(2) with loop based on write(2), test system
limit on the number of vectors writev(2) accepts and split call to writev(2)
to several calls in such a way that number of vectors in each call doesn't
exceed this limit (aka UIO_MAXIOV). Bump PORTREVISION.
Notes
Notes:
svn path=/head/; revision=49315
Diffstat (limited to 'devel/ORBit2/files/patch-src::IIOP::giop-msg-buffer.c')
-rw-r--r-- | devel/ORBit2/files/patch-src::IIOP::giop-msg-buffer.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/devel/ORBit2/files/patch-src::IIOP::giop-msg-buffer.c b/devel/ORBit2/files/patch-src::IIOP::giop-msg-buffer.c index a42320410527..d6184df8952a 100644 --- a/devel/ORBit2/files/patch-src::IIOP::giop-msg-buffer.c +++ b/devel/ORBit2/files/patch-src::IIOP::giop-msg-buffer.c @@ -1,24 +1,34 @@ $FreeBSD$ ---- src/IIOP/giop-msg-buffer.c 2001/10/26 12:42:42 1.1 -+++ src/IIOP/giop-msg-buffer.c 2001/10/26 12:42:53 -@@ -197,7 +197,17 @@ +--- src/IIOP/giop-msg-buffer.c.orig Wed Oct 3 09:51:21 2001 ++++ src/IIOP/giop-msg-buffer.c Sat Oct 27 15:52:11 2001 +@@ -34,10 +34,6 @@ + #include "IIOP.h" + #include "IIOP-private.h" + +-#ifdef HAVE_LIMITED_WRITEV +-#define writev g_writev +-#endif +- + /* type defs */ + + #ifdef __GNUC__ +@@ -197,7 +193,7 @@ sum); } #endif - res = writev(fd, curvec, nvecs); -+ for(sum = 0, t = 0; t < nvecs; t++) { -+ do { -+ res = write(fd, curvec[t].iov_base, curvec[t].iov_len); -+ } while (res < 0 && errno == EAGAIN); -+ if (res < 0) { -+ break; -+ } else -+ sum += res; -+ } -+ if (res >= 0) -+ res = sum; ++ res = g_writev(fd, curvec, nvecs); sum = (GIOP_MESSAGE_BUFFER(send_buffer)->message_header.message_size + sizeof(GIOPMessageHeader)); if(res < sum) { +@@ -227,7 +223,7 @@ + + fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); + +- t = writev(fd, curvec, nvecs); ++ t = g_writev(fd, curvec, nvecs); + + fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); + |