ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/loop.C
(Generate patch)

Comparing deliantra/server/socket/loop.C (file contents):
Revision 1.3 by root, Tue Aug 29 08:01:38 2006 UTC vs.
Revision 1.4 by root, Wed Aug 30 16:30:37 2006 UTC

1 1
2/* 2/*
3 * static char *rcsid_loop_c = 3 * static char *rcsid_loop_c =
4 * "$Id: loop.C,v 1.3 2006/08/29 08:01:38 root Exp $"; 4 * "$Id: loop.C,v 1.4 2006/08/30 16:30:37 root Exp $";
5 */ 5 */
6 6
7/* 7/*
8 CrossFire, A Multiplayer game for X-windows 8 CrossFire, A Multiplayer game for X-windows
9 9
201 stat = read(ns->fd, ns->inbuf.buf + ns->inbuf.len, 1); 201 stat = read(ns->fd, ns->inbuf.buf + ns->inbuf.len, 1);
202 } while ((stat<0) && (errno == EINTR)); 202 } while ((stat<0) && (errno == EINTR));
203 203
204 if (stat<0 && errno != EAGAIN && errno !=EWOULDBLOCK) { 204 if (stat<0 && errno != EAGAIN && errno !=EWOULDBLOCK) {
205#endif 205#endif
206 LOG(llevError, "Cannot read from socket: %s\n", strerror_local(errno)); 206 LOG(llevError, "Cannot read from socket: %s\n", strerror(errno));
207 ns->status = Ns_Dead; 207 ns->status = Ns_Dead;
208 return; 208 return;
209 } 209 }
210 if (stat == 0) return; 210 if (stat == 0) return;
211 } while (ns->inbuf.buf[ns->inbuf.len++]!='\n'); 211 } while (ns->inbuf.buf[ns->inbuf.len++]!='\n');
538 538
539 pollret= select(socket_info.max_filedescriptor, &tmp_read, &tmp_write, 539 pollret= select(socket_info.max_filedescriptor, &tmp_read, &tmp_write,
540 &tmp_exceptions, &socket_info.timeout); 540 &tmp_exceptions, &socket_info.timeout);
541 541
542 if (pollret==-1) { 542 if (pollret==-1) {
543 LOG(llevError, "select failed: %s\n", strerror_local(errno)); 543 LOG(llevError, "select failed: %s\n", strerror(errno));
544 return; 544 return;
545 } 545 }
546 546
547 /* We need to do some of the processing below regardless */ 547 /* We need to do some of the processing below regardless */
548/* if (!pollret) return;*/ 548/* if (!pollret) return;*/
574 break; 574 break;
575 } 575 }
576 } 576 }
577 init_sockets[newsocknum].fd=accept(init_sockets[0].fd, (struct sockaddr *)&addr, &addrlen); 577 init_sockets[newsocknum].fd=accept(init_sockets[0].fd, (struct sockaddr *)&addr, &addrlen);
578 if (init_sockets[newsocknum].fd==-1) { 578 if (init_sockets[newsocknum].fd==-1) {
579 LOG(llevError, "accept failed: %s\n", strerror_local(errno)); 579 LOG(llevError, "accept failed: %s\n", strerror(errno));
580 } 580 }
581 else { 581 else {
582 char buf[MAX_BUF]; 582 char buf[MAX_BUF];
583 long ip; 583 long ip;
584 NewSocket *ns; 584 NewSocket *ns;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines