synk

synchronize files between hosts
Log | Files | Refs | README | LICENSE

commit b2f3ca3bc98416b32e22a2c5737f1e40bf94b707
parent 1eb5f4be1f3e0da4bd419889f40a99dc67cd2ac6
Author: Willy <willyatmailoodotorg>
Date:   Mon Aug 22 14:17:22 +0200

Loop infinitely in server mode

Diffstat:
synk.c | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/synk.c b/synk.c @@ -190,13 +190,15 @@ server(in_addr_t host, in_port_t port) } len = sizeof(clt); - if ((cfd = accept(sfd, (struct sockaddr *)&clt, &len)) < 0) { - perror("accept"); - return 1; - } + for (;;) { + if ((cfd = accept(sfd, (struct sockaddr *)&clt, &len)) < 0) { + perror("accept"); + return 1; + } - handleclient(cfd, clt.sin_addr); + handleclient(cfd, clt.sin_addr); + } close(sfd); return 0;