From 78e72982093758eede259cbc4b171bd238623f37 Mon Sep 17 00:00:00 2001 From: Kithmini Gunawardhana Date: Mon, 8 Jan 2024 15:02:18 +0530 Subject: [PATCH] Fix for finding in invalid file descriptor in fallback mode (#395) --- src/sc/sc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sc/sc.cpp b/src/sc/sc.cpp index 4535fd77..66802cc4 100644 --- a/src/sc/sc.cpp +++ b/src/sc/sc.cpp @@ -179,7 +179,7 @@ namespace sc close_unused_fds(ctx, false); // Clone the user inputs fd to be passed on to the contract. - const int user_inputs_fd = dup(ctx.args.user_input_store.fd); + const int user_inputs_fd = (ctx.args.mode == EXECUTION_MODE::CONSENSUS_FALLBACK) ? STDIN_FILENO : dup(ctx.args.user_input_store.fd); lseek(user_inputs_fd, 0, SEEK_SET); // Reset seek position. // Write the contract execution args from HotPocket to the stdin (0) of the contract process.