From faebf197e2d7de25dfa6b0a50d7ac5291470b4e6 Mon Sep 17 00:00:00 2001 From: bde Date: Mon, 17 Aug 1998 17:28:10 +0000 Subject: Fixed nonsense overflow checking (checking that a long variable is less than INT_MAX after it has possibly overflowed). Removed an unused variable and its associated 2 style bugs. Removed unused includes. --- sys/kern/vfs_aio.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sys/kern/vfs_aio.c') diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index cdd3340..89e5a58 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -13,7 +13,7 @@ * bad that happens because of using this software isn't the responsibility * of the author. This software is distributed AS-IS. * - * $Id: vfs_aio.c,v 1.31 1998/07/05 20:33:18 julian Exp $ + * $Id: vfs_aio.c,v 1.32 1998/07/15 06:51:14 bde Exp $ */ /* @@ -30,8 +30,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -46,7 +45,6 @@ #include #include #include -#include #include #include @@ -541,7 +539,6 @@ aio_process(struct aiocblist *aiocbe) struct iovec aiov; unsigned int fd; int cnt; - static nperline=0; int error; off_t offset; int oublock_st, oublock_end; @@ -1277,9 +1274,10 @@ _aio_aqueue(struct proc *p, struct aiocb *job, struct aio_liojob *lj, int type) } aiocbe->uaiocb._aiocb_private.kernelinfo = (void *)(intptr_t)jobrefid; - jobrefid++; - if (jobrefid > INT_MAX) + if (jobrefid == LONG_MAX) jobrefid = 1; + else + jobrefid++; if (opcode == LIO_NOP) { TAILQ_INSERT_HEAD(&aio_freejobs, aiocbe, list); -- cgit v1.1