1
0
Fork 0

Fixed select()-call in fgfs-tools-{client,server} which occasionally led to lockup.

This commit is contained in:
Ralf Gerlich 2008-01-02 11:23:39 -08:00
parent b48ba44594
commit cf04dd3135
2 changed files with 3 additions and 2 deletions

View file

@ -159,7 +159,7 @@ long int get_next_task( const string& host, int port, long int last_tile ) {
FD_SET(sock, &ready);
// block until input from sock
select(32, &ready, 0, 0, NULL);
select(sock+1, &ready, 0, 0, NULL);
cout << " received reply" << endl;
if ( FD_ISSET(sock, &ready) ) {

View file

@ -364,7 +364,7 @@ int main( int argc, char **argv ) {
FD_SET(sock, &ready);
// block until we get some input on sock
select(32, &ready, 0, 0, NULL);
select(sock+1, &ready, 0, 0, NULL);
if ( FD_ISSET(sock, &ready) ) {
// printf("%d %d Incomming message --> ", getpid(), pid);
@ -409,6 +409,7 @@ int main( int argc, char **argv ) {
}
} else {
// This is the child
close(sock);
// cout << "new process started to handle new connection for "
// << next_tile << endl;