Sat Oct 8 15:48:07 2016 UTC ()
Uninitialized var, found by mootja; not tested, but obvious enough


(maxv)
diff -r1.67 -r1.68 src/sys/compat/sunos/sunos_ioctl.c
diff -r1.36 -r1.37 src/sys/compat/ultrix/ultrix_ioctl.c

cvs diff -r1.67 -r1.68 src/sys/compat/sunos/sunos_ioctl.c (expand / switch to unified diff)

--- src/sys/compat/sunos/sunos_ioctl.c 2015/12/12 17:48:18 1.67
+++ src/sys/compat/sunos/sunos_ioctl.c 2016/10/08 15:48:07 1.68
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sunos_ioctl.c,v 1.67 2015/12/12 17:48:18 nakayama Exp $ */ 1/* $NetBSD: sunos_ioctl.c,v 1.68 2016/10/08 15:48:07 maxv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1993 Markus Wild. 4 * Copyright (c) 1993 Markus Wild.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. The name of the author may not be used to endorse or promote products 12 * 2. The name of the author may not be used to endorse or promote products
13 * derived from this software without specific prior written permission 13 * derived from this software without specific prior written permission
14 * 14 *
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 * loosely from: Header: sunos_ioctl.c,v 1.7 93/05/28 04:40:43 torek Exp 26 * loosely from: Header: sunos_ioctl.c,v 1.7 93/05/28 04:40:43 torek Exp
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.67 2015/12/12 17:48:18 nakayama Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.68 2016/10/08 15:48:07 maxv Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/proc.h> 33#include <sys/proc.h>
34#include <sys/systm.h> 34#include <sys/systm.h>
35#include <sys/file.h> 35#include <sys/file.h>
36#include <sys/filedesc.h> 36#include <sys/filedesc.h>
37#include <sys/ioctl.h> 37#include <sys/ioctl.h>
38#include <sys/termios.h> 38#include <sys/termios.h>
39#include <sys/tty.h> 39#include <sys/tty.h>
40#include <sys/socket.h> 40#include <sys/socket.h>
41#include <sys/audioio.h> 41#include <sys/audioio.h>
42#include <sys/vnode.h> 42#include <sys/vnode.h>
43#include <sys/mount.h> 43#include <sys/mount.h>
@@ -433,27 +433,27 @@ sunos_sys_ioctl(struct lwp *l, const str @@ -433,27 +433,27 @@ sunos_sys_ioctl(struct lwp *l, const str
433 disc = 0; 433 disc = 0;
434 /* all other disciplines are not supported by NetBSD */ 434 /* all other disciplines are not supported by NetBSD */
435 if (disc) { 435 if (disc) {
436 error = ENXIO; 436 error = ENXIO;
437 break; 437 break;
438 } 438 }
439 439
440 error = (*ctl)(fp, TIOCSETD, &disc); 440 error = (*ctl)(fp, TIOCSETD, &disc);
441 } 441 }
442 case _IOW('t', 101, int): /* sun SUNOS_TIOCSSOFTCAR */ 442 case _IOW('t', 101, int): /* sun SUNOS_TIOCSSOFTCAR */
443 { 443 {
444 int x; /* unused */ 444 int x; /* unused */
445 445
446 error = copyin((void *)&x, SCARG(uap, data), sizeof x); 446 error = copyin(SCARG(uap, data), (void *)&x, sizeof x);
447 break; 447 break;
448 } 448 }
449 case _IOR('t', 100, int): /* sun SUNOS_TIOCSSOFTCAR */ 449 case _IOR('t', 100, int): /* sun SUNOS_TIOCSSOFTCAR */
450 { 450 {
451 int x = 0; 451 int x = 0;
452 452
453 error = copyout((void *)&x, SCARG(uap, data), sizeof x); 453 error = copyout((void *)&x, SCARG(uap, data), sizeof x);
454 break; 454 break;
455 } 455 }
456 case _IO('t', 36): /* sun TIOCCONS, no parameters */ 456 case _IO('t', 36): /* sun TIOCCONS, no parameters */
457 { 457 {
458 int on = 1; 458 int on = 1;
459 error = (*ctl)(fp, TIOCCONS, &on); 459 error = (*ctl)(fp, TIOCCONS, &on);

cvs diff -r1.36 -r1.37 src/sys/compat/ultrix/ultrix_ioctl.c (expand / switch to unified diff)

--- src/sys/compat/ultrix/ultrix_ioctl.c 2009/12/14 00:47:12 1.36
+++ src/sys/compat/ultrix/ultrix_ioctl.c 2016/10/08 15:48:07 1.37
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ultrix_ioctl.c,v 1.36 2009/12/14 00:47:12 matt Exp $ */ 1/* $NetBSD: ultrix_ioctl.c,v 1.37 2016/10/08 15:48:07 maxv Exp $ */
2/* from : NetBSD: sunos_ioctl.c,v 1.21 1995/10/07 06:27:31 mycroft Exp */ 2/* from : NetBSD: sunos_ioctl.c,v 1.21 1995/10/07 06:27:31 mycroft Exp */
3 3
4/* 4/*
5 * Copyright (c) 1993 Markus Wild. 5 * Copyright (c) 1993 Markus Wild.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. The name of the author may not be used to endorse or promote products 13 * 2. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission 14 * derived from this software without specific prior written permission
@@ -18,27 +18,27 @@ @@ -18,27 +18,27 @@
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 * 26 *
27 * loosely from: Header: sunos_ioctl.c,v 1.7 93/05/28 04:40:43 torek Exp 27 * loosely from: Header: sunos_ioctl.c,v 1.7 93/05/28 04:40:43 torek Exp
28 */ 28 */
29 29
30#include <sys/cdefs.h> 30#include <sys/cdefs.h>
31__KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.36 2009/12/14 00:47:12 matt Exp $"); 31__KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.37 2016/10/08 15:48:07 maxv Exp $");
32 32
33#if defined(_KERNEL_OPT) 33#if defined(_KERNEL_OPT)
34#include "opt_compat_ultrix.h" 34#include "opt_compat_ultrix.h"
35#include "opt_compat_sunos.h" 35#include "opt_compat_sunos.h"
36#endif 36#endif
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/proc.h> 39#include <sys/proc.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/file.h> 41#include <sys/file.h>
42#include <sys/filedesc.h> 42#include <sys/filedesc.h>
43#include <sys/ioctl.h> 43#include <sys/ioctl.h>
44#include <sys/termios.h> 44#include <sys/termios.h>
@@ -481,27 +481,27 @@ ultrix_sys_ioctl(struct lwp *l, const st @@ -481,27 +481,27 @@ ultrix_sys_ioctl(struct lwp *l, const st
481 /* map SunOS NTTYDISC into our termios discipline */ 481 /* map SunOS NTTYDISC into our termios discipline */
482 if (disc == 2) 482 if (disc == 2)
483 disc = 0; 483 disc = 0;
484 /* all other disciplines are not supported by NetBSD */ 484 /* all other disciplines are not supported by NetBSD */
485 if (disc) 485 if (disc)
486 return ENXIO; 486 return ENXIO;
487 487
488 return ultrix_do_ioctl(SCARG(&ap, fd), TIOCSETD, &disc, l); 488 return ultrix_do_ioctl(SCARG(&ap, fd), TIOCSETD, &disc, l);
489 } 489 }
490 case _IOW('t', 101, int): /* sun SUNOS_TIOCSSOFTCAR */ 490 case _IOW('t', 101, int): /* sun SUNOS_TIOCSSOFTCAR */
491 { 491 {
492 int x; /* unused */ 492 int x; /* unused */
493 493
494 return copyin(&x, SCARG(&ap, data), sizeof x); 494 return copyin(SCARG(&ap, data), &x, sizeof x);
495 } 495 }
496 case _IOR('t', 100, int): /* sun SUNOS_TIOCSSOFTCAR */ 496 case _IOR('t', 100, int): /* sun SUNOS_TIOCSSOFTCAR */
497 { 497 {
498 int x = 0; 498 int x = 0;
499 499
500 return copyout(&x, SCARG(&ap, data), sizeof x); 500 return copyout(&x, SCARG(&ap, data), sizeof x);
501 } 501 }
502 case _IO('t', 36): /* sun TIOCCONS, no parameters */ 502 case _IO('t', 36): /* sun TIOCCONS, no parameters */
503 { 503 {
504 int on = 1; 504 int on = 1;
505 return ultrix_do_ioctl(SCARG(&ap, fd), TIOCCONS, &on, l); 505 return ultrix_do_ioctl(SCARG(&ap, fd), TIOCCONS, &on, l);
506 } 506 }
507 case _IOW('t', 37, struct sunos_ttysize): 507 case _IOW('t', 37, struct sunos_ttysize):