Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 17:44:08 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293584 - stable/10/sys/compat/linux
Message-ID:  <201601091744.u09Hi8ju064922@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Jan  9 17:44:08 2016
New Revision: 293584
URL: https://svnweb.freebsd.org/changeset/base/293584

Log:
  MFC r283483:
  
  Convert signal number to native for VT_SETMODE ioctl and remove
  strange and invalid ISSIGVALID macro.
  The code has not been tested right way but it was originally broken.

Modified:
  stable/10/sys/compat/linux/linux_ioctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_ioctl.c
==============================================================================
--- stable/10/sys/compat/linux/linux_ioctl.c	Sat Jan  9 17:42:25 2016	(r293583)
+++ stable/10/sys/compat/linux/linux_ioctl.c	Sat Jan  9 17:44:08 2016	(r293584)
@@ -1976,8 +1976,6 @@ linux_ioctl_sound(struct thread *td, str
  * Console related ioctls
  */
 
-#define ISSIGVALID(sig)		((sig) > 0 && (sig) < NSIG)
-
 static int
 linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args)
 {
@@ -2060,8 +2058,16 @@ linux_ioctl_console(struct thread *td, s
 		struct vt_mode mode;
 		if ((error = copyin((void *)args->arg, &mode, sizeof(mode))))
 			break;
-		if (!ISSIGVALID(mode.frsig) && ISSIGVALID(mode.acqsig))
-			mode.frsig = mode.acqsig;
+		if (LINUX_SIG_VALID(mode.relsig))
+			mode.relsig = linux_to_bsd_signal(mode.relsig);
+		else
+			mode.relsig = 0;
+		if (LINUX_SIG_VALID(mode.acqsig))
+			mode.acqsig = linux_to_bsd_signal(mode.acqsig);
+		else
+			mode.acqsig = 0;
+		/* XXX. Linux ignores frsig and set it to 0. */
+		mode.frsig = 0;
 		if ((error = copyout(&mode, (void *)args->arg, sizeof(mode))))
 			break;
 		args->cmd = VT_SETMODE;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601091744.u09Hi8ju064922>