From 73483f3ec524ee2237b79e1512e00cfe3a129e14 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 31 Oct 2023 19:42:20 +0800 Subject: [PATCH] ses_steps_analyse() --- ses_core.h | 2 ++ ses_step_va.c | 3 ++- ses_step_va_bridge.c | 3 ++- ses_steps.c | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ses_core.h b/ses_core.h index 6ebf8c5..69a49f9 100644 --- a/ses_core.h +++ b/ses_core.h @@ -93,6 +93,8 @@ struct ses_path_s struct ses_ctx_s { scf_vector_t* paths; + + int changed; }; struct ses_step_s diff --git a/ses_step_va.c b/ses_step_va.c index a9d20bd..6397362 100644 --- a/ses_step_va.c +++ b/ses_step_va.c @@ -277,7 +277,8 @@ static int _va_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* ct printf("\n"); } - return changed > 0 ? -EAGAIN : 0; + ctx->changed += changed; + return 0; } ses_step_t ses_step_va = diff --git a/ses_step_va_bridge.c b/ses_step_va_bridge.c index 886b81a..e603110 100644 --- a/ses_step_va_bridge.c +++ b/ses_step_va_bridge.c @@ -87,7 +87,8 @@ static int _va_bridge_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ct printf("\n"); } - return changed > 0 ? -EAGAIN : 0; + ctx->changed += changed; + return 0; } ses_step_t ses_step_va_bridge = diff --git a/ses_steps.c b/ses_steps.c index bf53f4d..479cb00 100644 --- a/ses_steps.c +++ b/ses_steps.c @@ -107,6 +107,8 @@ static int __ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t i, ses_ctx_t int64_t j; + ctx->changed = 0; + for (j = 0; j < sizeof(ses_steps_1) / sizeof(ses_steps_1[0]); j++) { s = ses_steps_1[j]; @@ -120,7 +122,7 @@ static int __ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t i, ses_ctx_t } } - return 0; + return ctx->changed > 0 ? -EAGAIN : 0; } int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count) -- 2.25.1