Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern PR/50295: clock_nanotime() should not set errno, bu...
details: https://anonhg.NetBSD.org/src/rev/04aa59a16032
branches: trunk
changeset: 340803:04aa59a16032
user: christos <christos%NetBSD.org@localhost>
date: Fri Oct 02 19:47:08 2015 +0000
description:
PR/50295: clock_nanotime() should not set errno, but return the error.
diffstat:
sys/kern/kern_time.c | 14 +++++++++-----
sys/kern/syscalls.master | 4 ++--
2 files changed, 11 insertions(+), 7 deletions(-)
diffs (59 lines):
diff -r c3fe3f3a2842 -r 04aa59a16032 sys/kern/kern_time.c
--- a/sys/kern/kern_time.c Fri Oct 02 17:28:57 2015 +0000
+++ b/sys/kern/kern_time.c Fri Oct 02 19:47:08 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_time.c,v 1.180 2015/07/24 13:02:52 maxv Exp $ */
+/* $NetBSD: kern_time.c,v 1.181 2015/10/02 19:47:08 christos 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.180 2015/07/24 13:02:52 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.181 2015/10/02 19:47:08 christos Exp $");
#include <sys/param.h>
#include <sys/resourcevar.h>
@@ -310,15 +310,19 @@
error = copyin(SCARG(uap, rqtp), &rqt, sizeof(struct timespec));
if (error)
- return (error);
+ goto out;
error = nanosleep1(l, SCARG(uap, clock_id), SCARG(uap, flags), &rqt,
SCARG(uap, rmtp) ? &rmt : NULL);
if (SCARG(uap, rmtp) == NULL || (error != 0 && error != EINTR))
+ goto out;
return error;
- error1 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt));
- return error1 ? error1 : error;
+ if ((error1 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt))) != 0)
+ error = error1;
+out:
+ *retval = error;
+ return 0;
}
int
diff -r c3fe3f3a2842 -r 04aa59a16032 sys/kern/syscalls.master
--- a/sys/kern/syscalls.master Fri Oct 02 17:28:57 2015 +0000
+++ b/sys/kern/syscalls.master Fri Oct 02 19:47:08 2015 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.278 2015/06/18 15:16:12 pooka Exp $
+ $NetBSD: syscalls.master,v 1.279 2015/10/02 19:47:08 christos Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -981,7 +981,7 @@
struct timespec *timeout); }
476 STD RUMP { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, \
unsigned int vlen, unsigned int flags); }
-477 STD RUMP { int|sys||clock_nanosleep(clockid_t clock_id, \
+477 NOERR RUMP { int|sys||clock_nanosleep(clockid_t clock_id, \
int flags, const struct timespec *rqtp, \
struct timespec *rmtp); }
478 STD { int|sys|60|_lwp_park(clockid_t clock_id, int flags, \
Home |
Main Index |
Thread Index |
Old Index