procfs - fix incremental reads of /proc/*/rlimit
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Jul 2009 22:24:08 +0000 (15:24 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Jul 2009 22:24:08 +0000 (15:24 -0700)
The rlimit code was only properly copying data for all-in-one-go reads,
and mishandling incremental reads.

Submitted-by: Beket@@irc
sys/vfs/procfs/procfs_rlimit.c

index 790cdaa..811f499 100644 (file)
@@ -120,7 +120,7 @@ procfs_dorlimit(struct proc *curp, struct lwp *lp, struct pfsnode *pfs,
        if (xlen <= 0)
                error = 0;
        else
-               error = uiomove_frombuf(psbuf, ps - psbuf, uio);
+               error = uiomove_frombuf(psbuf, xlen, uio);
        return (error);
 }