Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Adjust clock_nanosleep(2) to not copyout remaining ...



details:   https://anonhg.NetBSD.org/src/rev/ec5b1c30f09d
branches:  trunk
changeset: 348851:ec5b1c30f09d
user:      njoly <njoly%NetBSD.org@localhost>
date:      Fri Nov 11 15:29:36 2016 +0000

description:
Adjust clock_nanosleep(2) to not copyout remaining time struct if
TIMER_ABSTIME flag is set.

Ok Christos.

diffstat:

 sys/kern/kern_time.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r c4ff04138995 -r ec5b1c30f09d sys/kern/kern_time.c
--- a/sys/kern/kern_time.c      Fri Nov 11 12:06:31 2016 +0000
+++ b/sys/kern/kern_time.c      Fri Nov 11 15:29:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_time.c,v 1.188 2016/07/07 06:55:43 msaitoh Exp $  */
+/*     $NetBSD: kern_time.c,v 1.189 2016/11/11 15:29:36 njoly Exp $    */
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.188 2016/07/07 06:55:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.189 2016/11/11 15:29:36 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/resourcevar.h>
@@ -319,7 +319,8 @@
        if (SCARG(uap, rmtp) == NULL || (error != 0 && error != EINTR))
                goto out;
 
-       if ((error1 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt))) != 0)
+       if ((SCARG(uap, flags) & TIMER_ABSTIME) == 0 &&
+           (error1 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt))) != 0)
                error = error1;
 out:
        *retval = error;



Home | Main Index | Thread Index | Old Index