{
unlink("/tmp/test_silcfdstream");
unlink("/tmp/test_silcfdstream_copy");
- SILC_FSM_FINISH;
+ return SILC_FSM_FINISH;
}
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;
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) {
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) {
}
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)
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;
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) {
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)
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;