diff options
author | ngie <ngie@FreeBSD.org> | 2015-12-28 02:21:36 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-12-28 02:21:36 +0000 |
commit | c1954809f8c4f8ce694824e1f2a61316a629322f (patch) | |
tree | 20e066947c721c9e4580e483436c8196966677b3 /tests | |
parent | 5fb486358b50fc6bb41e74a349c02631eaf26739 (diff) | |
download | FreeBSD-src-c1954809f8c4f8ce694824e1f2a61316a629322f.zip FreeBSD-src-c1954809f8c4f8ce694824e1f2a61316a629322f.tar.gz |
- Fix an improperly sized buffer for `pathname` [1]
- Fix a -Wunused-but-set-variable warning [2]
MFC after: 1 week
Reported by: cppcheck [1], gcc 4.9 [2]
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sys/aio/lio_kqueue_test.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/sys/aio/lio_kqueue_test.c b/tests/sys/aio/lio_kqueue_test.c index dc2e1a1..e69b9c9 100644 --- a/tests/sys/aio/lio_kqueue_test.c +++ b/tests/sys/aio/lio_kqueue_test.c @@ -62,7 +62,7 @@ main(int argc, char *argv[]) { int fd; struct aiocb *iocb[MAX_IOCBS]; - struct aiocb **lio[LIO_MAX], **lio_element, **kq_lio; + struct aiocb **lio[LIO_MAX], **kq_lio; int i, result, run, error, j, k; char buffer[32768]; int kq; @@ -70,7 +70,7 @@ main(int argc, char *argv[]) struct timespec ts; struct sigevent sig; time_t time1, time2; - char *file, pathname[sizeof(PATH_TEMPLATE)-1]; + char *file, pathname[sizeof(PATH_TEMPLATE)]; int tmp_file = 0, failed = 0; PLAIN_REQUIRE_KERNEL_MODULE("aio", 0); @@ -104,7 +104,6 @@ main(int argc, char *argv[]) malloc(sizeof(struct aiocb *) * MAX_IOCBS/LIO_MAX); for (i = 0; i < MAX_IOCBS / LIO_MAX; i++) { k = (MAX_IOCBS / LIO_MAX * j) + i; - lio_element = lio[j]; lio[j][i] = iocb[k] = calloc(1, sizeof(struct aiocb)); iocb[k]->aio_nbytes = sizeof(buffer); |