Module Name:    src
Committed By:   nat
Date:           Sun Jul  2 05:59:27 UTC 2017

Modified Files:
        src/sys/dev/pad: pad.c

Log Message:
Return early from read if kpause is interrupted by a signal.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pad/pad.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.39 src/sys/dev/pad/pad.c:1.40
--- src/sys/dev/pad/pad.c:1.39	Sat Jul  1 23:31:19 2017
+++ src/sys/dev/pad/pad.c	Sun Jul  2 05:59:27 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.39 2017/07/01 23:31:19 nat Exp $ */
+/* $NetBSD: pad.c,v 1.40 2017/07/02 05:59:27 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.39 2017/07/01 23:31:19 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.40 2017/07/02 05:59:27 nat Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -488,8 +488,12 @@ pad_read(struct file *fp, off_t *offp, s
 			wait_ticks = (hz * sc->sc_remainder) / 1000000;
 			if (wait_ticks > 0) {
 				sc->sc_remainder -= wait_ticks * 1000000 / hz;
-				kpause("padwait", TRUE, wait_ticks,
+				err = kpause("padwait", TRUE, wait_ticks,
 				    &sc->sc_lock);
+				if (err != EWOULDBLOCK) {
+					mutex_exit(&sc->sc_lock);
+					continue;
+				}
 			}
 		}
 

Reply via email to