/dev/klog: Ensure correct results in computation.
authorJordan Gordeev <jgordeev@dir.bg>
Fri, 12 Feb 2010 13:05:25 +0000 (15:05 +0200)
committerSascha Wildner <saw@online.de>
Sun, 21 Mar 2010 08:16:45 +0000 (09:16 +0100)
The 64-bit vkernel blows up without this change, unlike the pc64 kernel.

sys/kern/subr_log.c

index 4e68248..e6b4fa5 100644 (file)
@@ -143,7 +143,7 @@ logread(struct dev_read_args *ap)
        logsoftc.sc_state &= ~LOG_RDWAIT;
 
        while (uio->uio_resid > 0) {
-               l = mbp->msg_bufx - mbp->msg_bufr;
+               l = (long)mbp->msg_bufx - (long)mbp->msg_bufr;
                if (l < 0)
                        l = mbp->msg_size - mbp->msg_bufr;
                l = (long)szmin(l, uio->uio_resid);