-/* 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
*
* 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 $
*
****************************************************************/
/*
/* 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);
}