|
From: <wow...@us...> - 2015-07-14 16:25:46
|
Revision: 583
http://sourceforge.net/p/ptpd/code/583
Author: wowczarek
Date: 2015-07-14 16:25:43 +0000 (Tue, 14 Jul 2015)
Log Message:
-----------
Continued NTP select() EINTR fix
Modified Paths:
--------------
trunk/src/dep/ntpengine/ntpdcontrol.c
Modified: trunk/src/dep/ntpengine/ntpdcontrol.c
===================================================================
--- trunk/src/dep/ntpengine/ntpdcontrol.c 2015-07-14 16:16:19 UTC (rev 582)
+++ trunk/src/dep/ntpengine/ntpdcontrol.c 2015-07-14 16:25:43 UTC (rev 583)
@@ -405,21 +405,24 @@
lastseq = 999; /* too big to be a sequence number */
memset(haveseq, 0, sizeof(haveseq));
- FD_ZERO(&fds);
+
again:
if (firstpkt)
tvo = tvout;
else
tvo = tvsout;
-
- FD_SET(control->sockFD, &fds);
-
do {
+ FD_ZERO(&fds);
+ FD_SET(control->sockFD, &fds);
n = select(control->sockFD+1, &fds, (fd_set *)0, (fd_set *)0, &tvo);
- if( n == -1 && errno == EINTR) {
+ if(n == -1) {
+ if(errno == EINTR) {
DBG("NTPDCresponse(): EINTR caught\n");
- retries--;
+ retries--;
+ } else {
+ retries = 0;
+ }
}
} while ((n == -1) && retries);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|