fix return value

This commit is contained in:
2025-07-28 13:00:19 -06:00
parent 207c7a2919
commit 49bdf4f568
+2 -1
View File
@@ -72,6 +72,7 @@ void *sender(void *arg) {
void *receiver(void *arg) { void *receiver(void *arg) {
char buf[128]; char buf[128];
int bytes; int bytes;
char error[] = "pthread exit";
while (1) { while (1) {
memset(buf, 0, 128); memset(buf, 0, 128);
bytes = recv(confd, buf, 128, 0); bytes = recv(confd, buf, 128, 0);
@@ -81,7 +82,7 @@ void *receiver(void *arg) {
} }
else { else {
perror("recv"); perror("recv");
return -1; pthread_exit(&error);
} }
} }