diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-09-05 17:18:10 +0200 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-09-05 17:20:12 +0200 |
| commit | 88893a773cbd219f08cc3ae34fffe079d89a120d (patch) | |
| tree | 990eaeb2aef511d3e0c211b7eb4757ef25334edc /man7/aio.7 | |
| parent | 3b27ce1573535e0585b83b83a8b3828af70afe67 (diff) | |
| download | man-pages-88893a773cbd219f08cc3ae34fffe079d89a120d.tar.gz | |
sprof.1, eventfd.2, execve.2, futex.2, getdents.2, mprotect.2, open_by_handle_at.2, recvmmsg.2, sched_setaffinity.2, CPU_SET.3, backtrace.3, bsearch.3, dl_iterate_phdr.3, dlinfo.3, duplocale.3, encrypt.3, envz_add.3, fopencookie.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getgrent_r.3, getgrouplist.3, getifaddrs.3, getprotoent_r.3, getservent_r.3, hsearch.3, mallinfo.3, malloc_info.3, mbstowcs.3, mtrace.3, pthread_create.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, qsort.3, rand.3, strcat.3, strtok.3, tsearch.3, wordexp.3, core.5, aio.7, inotify.7, sock_diag.7, unix.7, user_namespaces.7: Use C99 style to declare loop counter variables
Rather than:
sometype x;
for (x = ....; ...)
use
for (sometype x = ...; ...)
This brings the declaration and use closer together (thus aiding
readability) and also clearly indicates the scope of the loop
counter variable.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man7/aio.7')
| -rw-r--r-- | man7/aio.7 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/man7/aio.7 b/man7/aio.7 index a9586a6943..ff099885ef 100644 --- a/man7/aio.7 +++ b/man7/aio.7 @@ -295,7 +295,7 @@ int main(int argc, char *argv[]) { struct sigaction sa; - int s, j; + int s; int numReqs; /* Total number of queued I/O requests */ int openReqs; /* Number of I/O requests still in progress */ @@ -334,7 +334,7 @@ main(int argc, char *argv[]) /* Open each file specified on the command line, and queue a read request on the resulting file descriptor */ - for (j = 0; j < numReqs; j++) { + for (int j = 0; j < numReqs; j++) { ioList[j].reqNum = j; ioList[j].status = EINPROGRESS; ioList[j].aiocbp = &aiocbList[j]; @@ -377,7 +377,7 @@ main(int argc, char *argv[]) printf("got SIGQUIT; canceling I/O requests: \en"); - for (j = 0; j < numReqs; j++) { + for (int j = 0; j < numReqs; j++) { if (ioList[j].status == EINPROGRESS) { printf(" Request %d on descriptor %d:", j, ioList[j].aiocbp\->aio_fildes); @@ -401,7 +401,7 @@ main(int argc, char *argv[]) in progress */ printf("aio_error():\en"); - for (j = 0; j < numReqs; j++) { + for (int j = 0; j < numReqs; j++) { if (ioList[j].status == EINPROGRESS) { printf(" for request %d (descriptor %d): ", j, ioList[j].aiocbp\->aio_fildes); @@ -433,7 +433,7 @@ main(int argc, char *argv[]) /* Check status return of all I/O requests */ printf("aio_return():\en"); - for (j = 0; j < numReqs; j++) { + for (int j = 0; j < numReqs; j++) { ssize_t s; s = aio_return(ioList[j].aiocbp); |
