Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pad Return early from read if kpause is interrupted ...



details:   https://anonhg.NetBSD.org/src/rev/23b15e5d90a4
branches:  trunk
changeset: 825159:23b15e5d90a4
user:      nat <nat%NetBSD.org@localhost>
date:      Sun Jul 02 05:59:27 2017 +0000

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

diffstat:

 sys/dev/pad/pad.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r cfb0bac6e61e -r 23b15e5d90a4 sys/dev/pad/pad.c
--- a/sys/dev/pad/pad.c Sun Jul 02 02:39:18 2017 +0000
+++ b/sys/dev/pad/pad.c Sun Jul 02 05:59:27 2017 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
                        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;
+                               }
                        }
                }
 



Home | Main Index | Thread Index | Old Index