mirror of https://github.com/wolfSSL/wolfssh.git
Move unsafe call out of signal handler
Cleanup clang-tidy bugprone-signal-handler findings. - wolfsshd: drop fprintf from interruptCatch; the main accept loop logs "Closing down wolfSSHD" after seeing quit set. - sftpclient: annotate wolfSSH_SFTP_Interrupt call in sig_handler with NOLINT, since the function is only a single byte store and is safe to call from a signal handler.pull/1002/head
parent
534500d66b
commit
304955ff94
|
|
@ -203,8 +203,6 @@ static void ShowUsage(void)
|
|||
static void interruptCatch(int in)
|
||||
{
|
||||
(void)in;
|
||||
if (logFile)
|
||||
fprintf(logFile, "Closing down wolfSSHD\n");
|
||||
quit = 1;
|
||||
}
|
||||
|
||||
|
|
@ -2762,6 +2760,9 @@ static int StartSSHD(int argc, char** argv)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
if (quit && logFile) {
|
||||
fprintf(logFile, "Closing down wolfSSHD\n");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ static void sig_handler(const int sig)
|
|||
(void)sig;
|
||||
|
||||
interrupt = 1;
|
||||
wolfSSH_SFTP_Interrupt(ssh);
|
||||
wolfSSH_SFTP_Interrupt(ssh); /* NOLINT(bugprone-signal-handler) */
|
||||
}
|
||||
#endif /* WS_NO_SIGNAL */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue