Fix for finding in invalid file descriptor in fallback mode (#395)

This commit is contained in:
Kithmini Gunawardhana
2024-01-08 15:02:18 +05:30
committed by GitHub
parent f38da0b437
commit 78e7298209

View File

@@ -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.