Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Aug 2015 16:22:22 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r287036 - stable/10/sys/kern
Message-ID:  <201508231622.t7NGMM1D095210@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Aug 23 16:22:21 2015
New Revision: 287036
URL: https://svnweb.freebsd.org/changeset/base/287036

Log:
  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.

Modified:
  stable/10/sys/kern/kern_tc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_tc.c
==============================================================================
--- stable/10/sys/kern/kern_tc.c	Sun Aug 23 16:17:00 2015	(r287035)
+++ stable/10/sys/kern/kern_tc.c	Sun Aug 23 16:22:21 2015	(r287036)
@@ -1511,8 +1511,12 @@ pps_fetch(struct pps_fetch_args *fapi, s
 			} 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 eve
 #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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508231622.t7NGMM1D095210>