Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Adjust compat netbsd32 clock_nanosleep(2...



details:   https://anonhg.NetBSD.org/src/rev/deec98476956
branches:  trunk
changeset: 341340:deec98476956
user:      njoly <njoly%NetBSD.org@localhost>
date:      Sat Oct 31 17:04:39 2015 +0000

description:
Adjust compat netbsd32 clock_nanosleep(2) to match recent native
changes that return error number.

diffstat:

 sys/compat/netbsd32/netbsd32_time.c |  19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diffs (54 lines):

diff -r 191ed8f01e94 -r deec98476956 sys/compat/netbsd32/netbsd32_time.c
--- a/sys/compat/netbsd32/netbsd32_time.c       Sat Oct 31 12:41:25 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_time.c       Sat Oct 31 17:04:39 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_time.c,v 1.45 2015/07/22 14:06:26 maxv Exp $  */
+/*     $NetBSD: netbsd32_time.c,v 1.46 2015/10/31 17:04:39 njoly Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.45 2015/07/22 14:06:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.46 2015/10/31 17:04:39 njoly Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -433,8 +433,8 @@
 netbsd32_clock_nanosleep(struct lwp *l, const struct netbsd32_clock_nanosleep_args *uap, register_t *retval)
 {
        /* {
-               clockid_t clock_id;
-               int flags;
+               syscallarg(clockid_t) clock_id;
+               syscallarg(int) flags;
                syscallarg(const netbsd32_timespecp_t) rqtp;
                syscallarg(netbsd32_timespecp_t) rmtp;
        } */
@@ -444,17 +444,20 @@
 
        error = copyin(SCARG_P32(uap, rqtp), &ts32, sizeof(ts32));
        if (error)
-               return (error);
+               goto out;
        netbsd32_to_timespec(&ts32, &rqt);
 
        error = nanosleep1(l, SCARG(uap, clock_id), SCARG(uap, flags),
            &rqt, SCARG_P32(uap, rmtp) ? &rmt : NULL);
        if (SCARG_P32(uap, rmtp) == NULL || (error != 0 && error != EINTR))
-               return error;
+               goto out;
 
        netbsd32_from_timespec(&rmt, &ts32);
-       error1 = copyout(&ts32, SCARG_P32(uap, rmtp), sizeof(ts32));
-       return error1 ? error1 : error;
+       if ((error1 = copyout(&ts32, SCARG_P32(uap, rmtp), sizeof(ts32))) != 0)
+               error = error1;
+out:
+       *retval = error;
+       return 0;
 }
 
 static int



Home | Main Index | Thread Index | Old Index