projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Aggiunta figura sul caso di aborto precoce della connessione. con revisione
[gapil.git]
/
listati
/
TCP_echod.c
diff --git
a/listati/TCP_echod.c
b/listati/TCP_echod.c
index 81085a7b5f59f831291723a6561475e6aaf624f5..3f17baaadca46d4b39da87610dc3ceeede1ca9b2 100644
(file)
--- a/
listati/TCP_echod.c
+++ b/
listati/TCP_echod.c
@@
-40,7
+40,9
@@
int main(int argc, char *argv[])
exit(1);
}
while (1) { /* handle echo to client */
exit(1);
}
while (1) { /* handle echo to client */
- if ( (conn_fd = accept(list_fd, NULL, NULL)) < 0) {
+ while (((conn_fd = accept(list_fd, NULL, NULL)) < 0)
+ && (errno == EINTR)); /* accept connection */
+ if ( conn_fd < 0) {
PrintErr("accept error");
exit(1);
}
PrintErr("accept error");
exit(1);
}