From 261a924b656eea9eff2ca6cbdd611eb1f9555af7 Mon Sep 17 00:00:00 2001 From: zhongtao Date: Thu, 30 Nov 2023 16:02:44 +1400 Subject: [PATCH 43/64] move variable declaration out of loop Signed-off-by: zhongtao --- src/daemon/modules/runtime/isula/isula_rt_ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/daemon/modules/runtime/isula/isula_rt_ops.c b/src/daemon/modules/runtime/isula/isula_rt_ops.c index 1e2ecdb2..3950ff4a 100644 --- a/src/daemon/modules/runtime/isula/isula_rt_ops.c +++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c @@ -612,6 +612,7 @@ out: static void transform_stats_info_from_runtime(shim_client_runtime_stats *stats, struct runtime_container_resources_stats_info *info) { + size_t i; if (stats == NULL || stats->data == NULL) { return; } @@ -637,7 +638,7 @@ static void transform_stats_info_from_runtime(shim_client_runtime_stats *stats, if (blkio == NULL) { return; } - for (size_t i = 0; i < blkio->io_service_bytes_recursive_len; i++) { + for (i = 0; i < blkio->io_service_bytes_recursive_len; i++) { if (strcasecmp(blkio->io_service_bytes_recursive[i]->op, "read") == 0) { info->blkio_read += blkio->io_service_bytes_recursive[i]->value; } -- 2.42.0