Skip to content

Commit

Permalink
Fix compile errors when WOLFSSH_TERM is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinux committed Sep 18, 2023
1 parent 79bc747 commit 7ff7675
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/client/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ typedef struct thread_args {
#endif


#ifdef WOLFSSH_TERM
static int sendCurrentWindowSize(thread_args* args)
{
int ret;
Expand Down Expand Up @@ -221,6 +222,7 @@ static int sendCurrentWindowSize(thread_args* args)

return ret;
}
#endif


#ifndef _MSC_VER
Expand Down Expand Up @@ -260,7 +262,9 @@ static THREAD_RET windowMonitor(void* in)
if (args->quit) {
break;
}
#ifdef WOLFSSH_TERM
ret = sendCurrentWindowSize(args);
#endif
(void)ret;
} while (1);

Expand Down Expand Up @@ -877,6 +881,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
sem_init(&windowSem, 0, 0);
#endif

#ifdef WOLFSSH_TERM
if (cmd) {
int err;

Expand All @@ -887,6 +892,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
fprintf(stderr, "Issue sending exec initial terminal size\n\r");
}
}
#endif

signal(SIGWINCH, WindowChangeSignal);
pthread_create(&thread[0], NULL, windowMonitor, (void*)&arg);
Expand Down
3 changes: 3 additions & 0 deletions src/ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ void* wolfSSH_GetPublicKeyCheckCtx(WOLFSSH* ssh)
return NULL;
}

#ifdef WOLFSSH_TERM

/* Used to resize terminal window with shell connections
* returns WS_SUCCESS on success */
Expand Down Expand Up @@ -1350,6 +1351,8 @@ void wolfSSH_SetTerminalResizeCtx(WOLFSSH* ssh, void* usrCtx)
ssh->termCtx = usrCtx;
}

#endif


/* Used to set the channel request type sent in wolfSSH connect. The default
* type set is shell if this function is not called.
Expand Down

0 comments on commit 7ff7675

Please sign in to comment.