Commit bd15ad43 authored by Dmitry Frank's avatar Dmitry Frank Committed by Cesanta Bot

Improve err handling in pubsub example

PUBLISHED_FROM=7660e252e1ac84bf2245718c548fb00288ff4e47
parent e5b3b8ad
......@@ -23,7 +23,9 @@ static void *stdin_thread(void *param) {
// Forward all types characters to the socketpair
while ((ch = getchar()) != EOF) {
unsigned char c = (unsigned char) ch;
send(sock, (const char *) &c, 1, 0);
if (send(sock, (const char *) &c, 1, 0) < 0) {
fprintf(stderr, "Failed to send byte to the socket");
}
}
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment