Re: [patch] abort running gpm on a serial console

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mike Frysinger [Tue, May 03, 2005 at 10:57:49PM -0400]:
> -   if ((fd=open(option.consolename, mode)) < 0)
> -      gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON);
> +   struct stat sb;
> +   int maj, twelve=12;
> +   struct serial_struct si;
> +
> +   fd = open(option.consolename, mode);
> +   if (fd != -1) {
> +      fstat(fd, &sb);
> +      maj = major(sb.st_rdev);
> +      if (maj != 4 && (maj < 136 || maj > 143)) {
> +          if (ioctl (fd, TIOCLINUX, &twelve) < 0) {
> +              if (si.line > 0)
> +                  gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON);
> +          }
> +      }

Is there no cleaner solution available? Having minor/major numbers
in gpm code is not a really good thing imho.

Nico

-- 
Latest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)
Open Source nutures open minds and free, creative developers.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
gpm mailing list
gpm@xxxxxxxxxxxxxx
http://lists.linux.it/listinfo/gpm

[Index of Archives]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Gimp]     [Yosemite News]