mirror of https://github.com/wolfSSL/wolfssh.git
examples: line-buffer stdout so tests reliably capture server output
parent
5f715daf02
commit
8dfdb63168
|
|
@ -101,6 +101,9 @@ int main(int argc, char* argv[])
|
|||
byte txt[] = "hello from tpmcertclient\n";
|
||||
byte rxBuf[TPMCC_BUF_SZ];
|
||||
|
||||
/* Line-buffer stdout so output is visible immediately when redirected. */
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (XSTRCMP(argv[i], "-p") == 0 && i + 1 < argc)
|
||||
port = (word16)atoi(argv[++i]);
|
||||
|
|
|
|||
|
|
@ -244,6 +244,10 @@ int main(int argc, char* argv[])
|
|||
byte certDer[TPMCS_CERT_MAX];
|
||||
word32 certDerSz = (word32)sizeof(certDer);
|
||||
|
||||
/* Line-buffer stdout so progress is visible immediately when redirected to
|
||||
* a file (the server runs while a test reads its output). */
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
|
||||
XMEMSET(&dev, 0, sizeof(dev));
|
||||
XMEMSET(&hostKey, 0, sizeof(hostKey));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue