summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-10-01 16:08:35 -0600
committerJens Axboe <axboe@kernel.dk>2019-10-01 16:08:35 -0600
commit6bf626224e9f488e34e2e9ba47cd1890a38cf43a (patch)
tree6c465d1d744af1fb46fc98787a1d52157ae8f261
parente2934e144409e6afc2678ef2558641755cbd4c43 (diff)
downloadliburing-6bf626224e9f488e34e2e9ba47cd1890a38cf43a.tar.gz
liburing-6bf626224e9f488e34e2e9ba47cd1890a38cf43a.tar.bz2
examples/ucontext-cp.c: get rid of c99 style declarations
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--examples/ucontext-cp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/ucontext-cp.c b/examples/ucontext-cp.c
index 211c271..3e95b15 100644
--- a/examples/ucontext-cp.c
+++ b/examples/ucontext-cp.c
@@ -182,38 +182,38 @@ static void copy_file_wrapper(arguments_bundle *pbundle)
int main(int argc, char *argv[])
{
- int ret;
+ struct io_uring ring;
+ int i, req_count, ret;
+ int success = 0, failure = 0;
if (argc < 3) {
fprintf(stderr, "%s: infile1 outfile1 [infile2 outfile2 [...]]\n", argv[0]);
return 1;
}
- struct io_uring ring;
ret = io_uring_queue_init(QD, &ring, 0);
if (ret < 0) {
fprintf(stderr, "queue_init: %s\n", strerror(-ret));
return -1;
}
- int req_count = (argc - 1) / 2;
-
+ req_count = (argc - 1) / 2;
printf("copying %d files...\n", req_count);
- int success = 0, failure = 0;
+ for (i = 1; i < argc; i += 2) {
+ int infd, outfd;
- for (int i = 1; i < argc; i += 2) {
async_context *pctx = malloc(sizeof(*pctx));
if (!pctx || setup_context(pctx, &ring))
return 1;
- int infd = open(argv[i], O_RDONLY);
+ infd = open(argv[i], O_RDONLY);
if (infd < 0) {
perror("open infile");
return 1;
}
- int outfd = open(argv[i + 1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ outfd = open(argv[i + 1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (outfd < 0) {
perror("open outfile");
return 1;