Module Name:    src
Committed By:   rin
Date:           Mon Nov 21 03:50:50 UTC 2016

Modified Files:
        src/sys/compat/netbsd32: netbsd32_ioctl.c

Log Message:
Handle CLOCKCTL_NTP_ADJTIME32 even when compiled with !NTP;
just return ENOTTY in order to avoid possible failure when
main kernel and compat_netbsd32 module are compiled with
different NTP options in future.

Suggested and approved by mlelstv


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/compat/netbsd32/netbsd32_ioctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.86 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.87
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.86	Tue Nov 15 10:57:57 2016
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Mon Nov 21 03:50:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.86 2016/11/15 10:57:57 rin Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.87 2016/11/21 03:50:50 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.86 2016/11/15 10:57:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.87 2016/11/21 03:50:50 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -1324,8 +1324,8 @@ netbsd32_ioctl(struct lwp *l, const stru
 	case CLOCKCTL_CLOCK_SETTIME32:
 		IOCTL_STRUCT_CONV_TO(CLOCKCTL_CLOCK_SETTIME,
 		    clockctl_clock_settime);
-#ifdef NTP
 	case CLOCKCTL_NTP_ADJTIME32:
+#ifdef NTP
 		{
 			size = IOCPARM_LEN(CLOCKCTL_NTP_ADJTIME);
 			if (size > sizeof(stkbuf))
@@ -1346,7 +1346,10 @@ netbsd32_ioctl(struct lwp *l, const stru
 
 			break;
 		}
-#endif
+#else
+		error = ENOTTY;
+		break;
+#endif /* NTP */
 
 	case KIOCGSYMBOL32:
 		IOCTL_STRUCT_CONV_TO(KIOCGSYMBOL, ksyms_gsymbol);

Reply via email to