pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/xentools20 Add patch from Jed Davis on port-xen:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/10ecd204e68f
branches:  trunk
changeset: 499256:10ecd204e68f
user:      bouyer <bouyer%pkgsrc.org@localhost>
date:      Fri Sep 16 18:14:49 2005 +0000

description:
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:

 sysutils/xentools20/Makefile         |   4 +-
 sysutils/xentools20/distinfo         |   3 +-
 sysutils/xentools20/patches/patch-aw |  59 ++++++++++++++++++++++++++++++++++++
 3 files changed, 63 insertions(+), 3 deletions(-)

diffs (92 lines):

diff -r 8fbe97dd49bb -r 10ecd204e68f sysutils/xentools20/Makefile
--- a/sysutils/xentools20/Makefile      Fri Sep 16 15:24:23 2005 +0000
+++ b/sysutils/xentools20/Makefile      Fri Sep 16 18:14:49 2005 +0000
@@ -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 -r 8fbe97dd49bb -r 10ecd204e68f sysutils/xentools20/distinfo
--- a/sysutils/xentools20/distinfo      Fri Sep 16 15:24:23 2005 +0000
+++ b/sysutils/xentools20/distinfo      Fri Sep 16 18:14:49 2005 +0000
@@ -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-at) = 0964bc7dd23ff6fcd596d6a8564d9e3033f34563
 SHA1 (patch-au) = a5eb7b34d43f57a3e1d4644e98ec571f30c56f5e
 SHA1 (patch-av) = 8de5c95093571670f3eedf71684634f999ebda54
+SHA1 (patch-aw) = cb66cce69dc7cecb478702108f2905a22ffc3aed
diff -r 8fbe97dd49bb -r 10ecd204e68f sysutils/xentools20/patches/patch-aw
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xentools20/patches/patch-aw      Fri Sep 16 18:14:49 2005 +0000
@@ -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().
+  *



Home | Main Index | Thread Index | Old Index