summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_time.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 78e1c7fbd95..d2d8ddae120 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.62 2007/04/04 17:32:20 art Exp $ */
+/* $OpenBSD: kern_time.c,v 1.63 2008/01/02 17:57:49 miod Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -257,7 +257,7 @@ sys_nanosleep(struct proc *p, void *v, register_t *retval)
struct timespec rqt, rmt;
struct timespec sts, ets;
struct timeval tv;
- int error;
+ int error, error1;
error = copyin((const void *)SCARG(uap, rqtp), (void *)&rqt,
sizeof(struct timespec));
@@ -287,8 +287,10 @@ sys_nanosleep(struct proc *p, void *v, register_t *retval)
if (rmt.tv_sec < 0)
timespecclear(&rmt);
- error = copyout((void *)&rmt, (void *)SCARG(uap,rmtp),
+ error1 = copyout((void *)&rmt, (void *)SCARG(uap,rmtp),
sizeof(rmt));
+ if (error1 != 0)
+ error = error1;
}
return error;