diff --git a/linux/rollup/ioctl-echo-loop/ioctl-echo-loop.c b/linux/rollup/ioctl-echo-loop/ioctl-echo-loop.c index 407e375d..af3f38ce 100644 --- a/linux/rollup/ioctl-echo-loop/ioctl-echo-loop.c +++ b/linux/rollup/ioctl-echo-loop/ioctl-echo-loop.c @@ -14,16 +14,15 @@ * limitations under the License. */ - -#include +#include #include #include +#include #include #include #include +#include #include -#include -#include #include @@ -188,7 +187,8 @@ static int write_exception(int fd, struct rollup_bytes *bytes, unsigned verbose) return 0; } -static int handle_advance_state_request(int fd, struct parsed_args *args, struct rollup_finish *finish, struct rollup_bytes *bytes, struct rollup_input_metadata *metadata) { +static int handle_advance_state_request(int fd, struct parsed_args *args, struct rollup_finish *finish, + struct rollup_bytes *bytes, struct rollup_input_metadata *metadata) { struct rollup_advance_state req; int res = 0; if (resize_bytes(bytes, finish->next_request_payload_length) != 0) { @@ -244,7 +244,8 @@ static int handle_inspect_state_request(int fd, struct parsed_args *args, struct return 0; } -static int handle_request(int fd, struct parsed_args *args, struct rollup_finish *finish, struct rollup_bytes *bytes, struct rollup_input_metadata *metadata) { +static int handle_request(int fd, struct parsed_args *args, struct rollup_finish *finish, struct rollup_bytes *bytes, + struct rollup_input_metadata *metadata) { switch (finish->next_request_type) { case CARTESI_ROLLUP_ADVANCE_STATE: return handle_advance_state_request(fd, args, finish, bytes, metadata); @@ -293,12 +294,10 @@ int main(int argc, char *argv[]) { break; } reject_advance = - (finish.next_request_type == CARTESI_ROLLUP_ADVANCE_STATE) && - (args.reject == metadata.input_index); - reject_inspect = - (finish.next_request_type == CARTESI_ROLLUP_INSPECT_STATE) && args.reject_inspects; - throw_exception = (finish.next_request_type == CARTESI_ROLLUP_ADVANCE_STATE) && - (args.exception == metadata.input_index); + (finish.next_request_type == CARTESI_ROLLUP_ADVANCE_STATE) && (args.reject == metadata.input_index); + reject_inspect = (finish.next_request_type == CARTESI_ROLLUP_INSPECT_STATE) && args.reject_inspects; + throw_exception = + (finish.next_request_type == CARTESI_ROLLUP_ADVANCE_STATE) && (args.exception == metadata.input_index); if (throw_exception) { write_exception(fd, &bytes, args.verbose); }