MFC r286423, r286429:

RFC 2783 requires a status of ETIMEDOUT, not EWOULDBLOCK, on a timeout.

  Only process the PPS event types currently enabled in pps_params.mode.
This commit is contained in:
ian 2015-08-23 16:22:21 +00:00
parent 341404d849
commit 50ce2fd7fc

View File

@ -1511,8 +1511,12 @@ pps_fetch(struct pps_fetch_args *fapi, struct pps_state *pps)
} else {
err = tsleep(pps, PCATCH, "ppsfch", timo);
}
if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) {
continue;
if (err == EWOULDBLOCK) {
if (fapi->timeout.tv_sec == -1) {
continue;
} else {
return (ETIMEDOUT);
}
} else if (err != 0) {
return (err);
}
@ -1668,6 +1672,9 @@ pps_event(struct pps_state *pps, int event)
#endif
KASSERT(pps != NULL, ("NULL pps pointer in pps_event"));
/* Nothing to do if not currently set to capture this event type. */
if ((event & pps->ppsparam.mode) == 0)
return;
/* If the timecounter was wound up underneath us, bail out. */
if (pps->capgen == 0 || pps->capgen != pps->capth->th_generation)
return;