Source-Changes-HG archive

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

[src/trunk]: src/lib/libkvm Do not return -1 on _kvm_read when all the reques...



details:   https://anonhg.NetBSD.org/src/rev/2717ab10ad4a
branches:  trunk
changeset: 758158:2717ab10ad4a
user:      stacktic <stacktic%NetBSD.org@localhost>
date:      Sat Oct 23 14:34:12 2010 +0000

description:
Do not return -1 on _kvm_read when all the requested data could be read (fix bin/38648)

diffstat:

 lib/libkvm/kvm.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 70b46d25ba91 -r 2717ab10ad4a lib/libkvm/kvm.c
--- a/lib/libkvm/kvm.c  Sat Oct 23 14:12:50 2010 +0000
+++ b/lib/libkvm/kvm.c  Sat Oct 23 14:34:12 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm.c,v 1.95 2010/09/20 23:23:16 jym Exp $     */
+/*     $NetBSD: kvm.c,v 1.96 2010/10/23 14:34:12 stacktic Exp $        */
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm.c      8.2 (Berkeley) 2/13/94";
 #else
-__RCSID("$NetBSD: kvm.c,v 1.95 2010/09/20 23:23:16 jym Exp $");
+__RCSID("$NetBSD: kvm.c,v 1.96 2010/10/23 14:34:12 stacktic Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -216,7 +216,7 @@
                kd->iobufsz = dsize;
        }
        rv = pread(fd, kd->iobuf, dsize, doff);
-       if (rv < dsize)
+       if (rv < size + moff)
                return -1;
        memcpy(buf, kd->iobuf + moff, size);
        return size;



Home | Main Index | Thread Index | Old Index