diff options
author | bouyer <bouyer@pkgsrc.org> | 2005-09-16 18:14:49 +0000 |
---|---|---|
committer | bouyer <bouyer@pkgsrc.org> | 2005-09-16 18:14:49 +0000 |
commit | 73cc7fc036b23b2b2b0e8d88513570625234c97c (patch) | |
tree | 3c2e486cbfb9b59be5fabe2f30ed63db8c56741c /sysutils/xentools20 | |
parent | 0769c4ce18d86a8a0b3eacfb143e3b1775f6aa67 (diff) | |
download | pkgsrc-73cc7fc036b23b2b2b0e8d88513570625234c97c.tar.gz |
Add patch from Jed Davis on port-xen:
| xfrd reads from the network socket using
| fread() on an _IONBF'ed stream; under NetBSD, this results in a
| sequence of one-character reads. This behavior, as far as I can tell,
| goes back all the way to V7 Unix; i.e., it's older than me.
|
| So I've modified libxutil, which has its own IO indirection layer, to
| switch to read(2) in the "unbuffered" case"
bump PKGREVISION
Diffstat (limited to 'sysutils/xentools20')
-rw-r--r-- | sysutils/xentools20/Makefile | 4 | ||||
-rw-r--r-- | sysutils/xentools20/distinfo | 3 | ||||
-rw-r--r-- | sysutils/xentools20/patches/patch-aw | 59 |
3 files changed, 63 insertions, 3 deletions
diff --git a/sysutils/xentools20/Makefile b/sysutils/xentools20/Makefile index 5e2cc1b1eda..270f151cbcc 100644 --- a/sysutils/xentools20/Makefile +++ b/sysutils/xentools20/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.19 2005/09/10 15:54:38 bouyer Exp $ +# $NetBSD: Makefile,v 1.20 2005/09/16 18:14:49 bouyer Exp $ # DISTNAME= xen-2.0.7-src PKGNAME= xentools20-2.0.7 -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= sysutils MASTER_SITES= http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/ EXTRACT_SUFX= .tgz diff --git a/sysutils/xentools20/distinfo b/sysutils/xentools20/distinfo index 95e97334312..4e51cce8ac0 100644 --- a/sysutils/xentools20/distinfo +++ b/sysutils/xentools20/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.11 2005/09/10 15:54:38 bouyer Exp $ +$NetBSD: distinfo,v 1.12 2005/09/16 18:14:49 bouyer Exp $ SHA1 (xen-2.0.7-src.tgz) = 5317100e1e062961e3fee398fccbf023eb8f0337 RMD160 (xen-2.0.7-src.tgz) = db99fb49e592df7229d4d361c48bab1d23a1d725 @@ -20,3 +20,4 @@ SHA1 (patch-as) = 333da168af43dae9a4e8695409cbd006e7fcf097 SHA1 (patch-at) = 0964bc7dd23ff6fcd596d6a8564d9e3033f34563 SHA1 (patch-au) = a5eb7b34d43f57a3e1d4644e98ec571f30c56f5e SHA1 (patch-av) = 8de5c95093571670f3eedf71684634f999ebda54 +SHA1 (patch-aw) = cb66cce69dc7cecb478702108f2905a22ffc3aed diff --git a/sysutils/xentools20/patches/patch-aw b/sysutils/xentools20/patches/patch-aw new file mode 100644 index 00000000000..20fdb0e7490 --- /dev/null +++ b/sysutils/xentools20/patches/patch-aw @@ -0,0 +1,59 @@ +$NetBSD: patch-aw,v 1.1 2005/09/16 18:14:49 bouyer Exp $ + +--- libxutil/file_stream.c.orig 2005-09-13 17:02:16.000000000 -0400 ++++ libxutil/file_stream.c 2005-09-13 17:31:39.000000000 -0400 +@@ -21,11 +21,13 @@ + */ + #ifndef __KERNEL__ + #include <stdio.h> ++#include <unistd.h> + #include <stdlib.h> + #include "allocate.h" + #include "file_stream.h" + + static int file_read(IOStream *s, void *buf, size_t n); ++static int file_read_nbuf(IOStream *s, void* buf, size_t n); + static int file_write(IOStream *s, const void *buf, size_t n); + static int file_error(IOStream *s); + static int file_close(IOStream *s); +@@ -42,6 +44,16 @@ + flush: file_flush, + }; + ++/** Methods used by a FILE* IOStream that's unbuffered. */ ++static const IOMethods file_methods_nbuf = { ++ read: file_read_nbuf, ++ write: file_write, ++ error: file_error, ++ close: file_close, ++ free: file_free, ++ flush: file_flush, ++}; ++ + /** IOStream for stdin. */ + static IOStream _iostdin = { + methods: &file_methods, +@@ -102,6 +114,7 @@ + * @return 0 on success, non-zero otherwise + */ + int file_stream_setvbuf(IOStream *io, char *buf, int mode, size_t size){ ++ io->methods = (mode == _IONBF) ? &file_methods_nbuf : &file_methods; + return setvbuf(get_file(io), buf, mode, size); + } + +@@ -126,6 +139,15 @@ + static int file_read(IOStream *s, void *buf, size_t n){ + return fread(buf, 1, n, get_file(s)); + } ++static int file_read_nbuf(IOStream *s, void *buf, size_t n){ ++ int fd = fileno(get_file(s)), rv, nr=0; ++ while(n > nr) { ++ rv = read(fd, buf+nr, n-nr); ++ if (rv <= 0) break; ++ nr += rv; ++ } ++ return nr; ++} + + /** Fush the underlying stream using fflush(). + * |