Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/common PR/44674: Taylor R Campbell: Fix compat co...



details:   https://anonhg.NetBSD.org/src/rev/d2d95967d4f8
branches:  trunk
changeset: 762864:d2d95967d4f8
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Mar 04 01:36:56 2011 +0000

description:
PR/44674: Taylor R Campbell: Fix compat copyin and copyout routines which
were obviously broken.

diffstat:

 sys/compat/common/kern_time_50.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (47 lines):

diff -r d7ed76cdf331 -r d2d95967d4f8 sys/compat/common/kern_time_50.c
--- a/sys/compat/common/kern_time_50.c  Fri Mar 04 00:40:48 2011 +0000
+++ b/sys/compat/common/kern_time_50.c  Fri Mar 04 01:36:56 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_time_50.c,v 1.18 2011/01/19 10:21:16 tsutsui Exp $        */
+/*     $NetBSD: kern_time_50.c,v 1.19 2011/03/04 01:36:56 christos Exp $       */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.18 2011/01/19 10:21:16 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.19 2011/03/04 01:36:56 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -453,8 +453,10 @@
 tscopyin(const void *u, void *s, size_t len)
 {
        struct timespec50 ts50;
-       KASSERT(len == sizeof(ts50));
-       int error = copyin(u, &ts50, len);
+       int error;
+
+       KASSERT(len == sizeof(struct timespec));
+       error = copyin(u, &ts50, sizeof(ts50));
        if (error)
                return error;
        timespec50_to_timespec(&ts50, s);
@@ -465,12 +467,10 @@
 tscopyout(const void *s, void *u, size_t len)
 {
        struct timespec50 ts50;
-       KASSERT(len == sizeof(ts50));
+
+       KASSERT(len == sizeof(struct timespec));
        timespec_to_timespec50(s, &ts50);
-       int error = copyout(&ts50, u, len);
-       if (error)
-               return error;
-       return 0;
+       return copyout(&ts50, u, sizeof(ts50));
 }
 
 int



Home | Main Index | Thread Index | Old Index