Si comincia a correggere il server
[gapil.git] / sources / TCP_echod.c
index 606f85281c81117797816563483880e32814f43f..3cc5ba30804a43fa09616701a420c9999e192d43 100644 (file)
@@ -1,6 +1,6 @@
-/* ElemEchoTCPServer.c
+/* TCP_echod.c
  * 
- * Copyright (C) 2001 Simone Piccardi
+ * Copyright (C) 2001-2003 Simone Piccardi
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
  *
  * Usage: echod -h give all info
  *
- * $Id: TCP_echod.c,v 1.1 2003/05/02 09:50:55 piccardi Exp $ 
+ * $Id: TCP_echod.c,v 1.3 2003/05/12 22:52:29 piccardi Exp $ 
  *
  ****************************************************************/
 /* 
@@ -136,7 +136,9 @@ int main(int argc, char *argv[])
     /* handle echo to client */
     while (1) {
        /* accept connection */
-       if ( (conn_fd = accept(list_fd, NULL, NULL)) < 0) {
+       while (((conn_fd = accept(list_fd, NULL, NULL)) < 0) 
+              && (errno == EINTR)); 
+       if ( conn_fd < 0) {
            PrintErr("accept error");
            exit(1);
        }