X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Ftests%2Ftest_silcfdstream.c;h=dfc231733b92040517a864e970f4f1dac5c205b6;hb=e7b6c157b80152bf9fb9266e6bdd93f9fb0db776;hp=c0039b1ce5f73d72deef4b6035e42bc5751f06b4;hpb=aa427d8e98d1b24952f869062536ca6c49670479;p=silc.git diff --git a/lib/silcutil/tests/test_silcfdstream.c b/lib/silcutil/tests/test_silcfdstream.c index c0039b1c..dfc23173 100644 --- a/lib/silcutil/tests/test_silcfdstream.c +++ b/lib/silcutil/tests/test_silcfdstream.c @@ -32,7 +32,7 @@ SILC_FSM_STATE(st_end) { unlink("/tmp/test_silcfdstream"); unlink("/tmp/test_silcfdstream_copy"); - SILC_FSM_FINISH; + return SILC_FSM_FINISH; } SILC_FSM_STATE(st_readwrite) @@ -58,7 +58,7 @@ SILC_FSM_STATE(st_readwrite) } SILC_LOG_DEBUG(("Creating FD stream (two fds)")); - stream = silc_fd_stream_create2(fd1, fd2); + stream = silc_fd_stream_create2(fd1, fd2, NULL); if (!stream) { SILC_LOG_DEBUG(("Error creating stream")); goto err; @@ -83,7 +83,7 @@ SILC_FSM_STATE(st_readwrite) if (i == -1) { SILC_LOG_DEBUG(("Would block, write later")); silc_fsm_next(fsm, st_end); - SILC_FSM_WAIT; + return SILC_FSM_WAIT; } if (i == -2) { @@ -99,7 +99,7 @@ SILC_FSM_STATE(st_readwrite) if (ret == -1) { SILC_LOG_DEBUG(("Would block, read later")); silc_fsm_next(fsm, st_end); - SILC_FSM_WAIT; + return SILC_FSM_WAIT; } if (ret == -2) { @@ -117,11 +117,11 @@ SILC_FSM_STATE(st_readwrite) } silc_fsm_next(fsm, st_end); - SILC_FSM_CONTINUE; + return SILC_FSM_CONTINUE; err: silc_fsm_next(fsm, st_end); - SILC_FSM_CONTINUE; + return SILC_FSM_CONTINUE; } SILC_FSM_STATE(st_write) @@ -133,7 +133,7 @@ SILC_FSM_STATE(st_write) SILC_LOG_DEBUG(("Open file /tmp/test_silcfdstream for writing")); SILC_LOG_DEBUG(("Creating FD stream")); unlink("/tmp/test_silcfdstream"); - stream = silc_fd_stream_file("/tmp/test_silcfdstream", FALSE, TRUE); + stream = silc_fd_stream_file("/tmp/test_silcfdstream", FALSE, TRUE, NULL); if (!stream) { SILC_LOG_DEBUG(("Error creating stream")); goto err; @@ -159,7 +159,7 @@ SILC_FSM_STATE(st_write) if (ret == -1) { SILC_LOG_DEBUG(("Would block, write later")); silc_fsm_next(fsm, st_readwrite); - SILC_FSM_WAIT; + return SILC_FSM_WAIT; } if (ret == -2) { @@ -179,11 +179,11 @@ SILC_FSM_STATE(st_write) SILC_LOG_DEBUG(("Continue to next state")); silc_fsm_next(fsm, st_readwrite); - SILC_FSM_CONTINUE; + return SILC_FSM_CONTINUE; err: silc_fsm_next(fsm, st_end); - SILC_FSM_CONTINUE; + return SILC_FSM_CONTINUE; } static void fsm_dest(SilcFSM fsm, void *fsm_context, void *context) @@ -199,11 +199,11 @@ int main(int argc, char **argv) if (argc > 1 && !strcmp(argv[1], "-d")) { silc_log_debug(TRUE); silc_log_debug_hexdump(TRUE); - silc_log_set_debug_string("*fdstream*"); + silc_log_set_debug_string("*fdstream*,*errno*"); } SILC_LOG_DEBUG(("Allocating scheduler")); - schedule = silc_schedule_init(0, NULL); + schedule = silc_schedule_init(0, NULL, NULL); if (!schedule) goto err;