fix return value
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user