mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-07 09:27:05 +08:00
Improve err handling in pubsub example
PUBLISHED_FROM=7660e252e1ac84bf2245718c548fb00288ff4e47
This commit is contained in:
parent
e5b3b8ad32
commit
bd15ad4301
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user