Commit 1c0e19af authored by William Gropp's avatar William Gropp
Browse files

[svn-r10761] Added more error checking

parent 7ea543dc
......@@ -81,11 +81,19 @@ SOCKET_FD_TYPE server_routine(int portnum)
return -1;
}
listen(listenfd, 1024);
ret = listen(listenfd, 1024);
if (ret < 0) {
perror( "server listen" );
return -1;
}
peer_addr_size = sizeof(peer_addr);
peer_fd = accept(listenfd, (struct sockaddr *)&peer_addr, &peer_addr_size);
if (peer_fd < 0) {
perror( "server accept" );
return -1;
}
return peer_fd;
}
......
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