Two more trivial bug fixes:
- copyin() the ntv argument to ntp_adjtime1(), to avoid some panics - correctly handle the return value And this still relates to kern/15519
This commit is contained in:
parent
1caa35aa0f
commit
f48c7db878
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: clockctl.c,v 1.5 2002/02/25 21:16:36 manu Exp $ */
|
||||
/* $NetBSD: clockctl.c,v 1.6 2002/03/01 22:58:33 manu Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.5 2002/02/25 21:16:36 manu Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.6 2002/03/01 22:58:33 manu Exp $");
|
||||
|
||||
#include "opt_ntp.h"
|
||||
|
||||
|
@ -126,9 +126,16 @@ clockctlioctl(dev, cmd, data, flags, p)
|
|||
case CLOCKCTL_NTP_ADJTIME: {
|
||||
struct clockctl_ntp_adjtime_args *args =
|
||||
(struct clockctl_ntp_adjtime_args *)data;
|
||||
struct timex ntv;
|
||||
|
||||
(void)ntp_adjtime1(SCARG(args,uas.tp), args, &error);
|
||||
return (error);
|
||||
error = copyin((caddr_t)SCARG(args,uas.tp),
|
||||
(caddr_t)&ntv, sizeof(ntv));
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
error = ntp_adjtime1(&ntv, args, &args->retval);
|
||||
return (error);
|
||||
break;
|
||||
}
|
||||
#endif /* NTP */
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue