svn commit: r279164 - user/dchagin/lemul/sys/compat/linux

Dmitry Chagin dchagin at FreeBSD.org
Sun Feb 22 16:08:28 UTC 2015


Author: dchagin
Date: Sun Feb 22 16:08:27 2015
New Revision: 279164
URL: https://svnweb.freebsd.org/changeset/base/279164

Log:
  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:
  user/dchagin/lemul/sys/compat/linux/linux_ioctl.c

Modified: user/dchagin/lemul/sys/compat/linux/linux_ioctl.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_ioctl.c	Sun Feb 22 16:04:37 2015	(r279163)
+++ user/dchagin/lemul/sys/compat/linux/linux_ioctl.c	Sun Feb 22 16:08:27 2015	(r279164)
@@ -1977,8 +1977,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)
 {
@@ -2061,8 +2059,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;


More information about the svn-src-user mailing list