OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.8 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../kbd/devpts.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. # Copyright (C) 1998 - 2004 Clifford Wolf
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This patch file is dual-licensed. It is available under the license the
  11. # patched project is licensed under, as long as it is an OpenSource license
  12. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  13. # of the GNU General Public License as published by the Free Software
  14. # Foundation; either version 2 of the License, or (at your option) any later
  15. # version.
  16. # --- T2-COPYRIGHT-NOTE-END ---
  17. --- ./openvt/openvt.c.orig 2003-08-16 16:44:04.000000000 +0300
  18. +++ ./openvt/openvt.c 2003-08-16 16:42:01.000000000 +0300
  19. @@ -100,18 +100,18 @@
  20. }
  21. consfd = getfd();
  22. - if (consfd < 0) {
  23. - fprintf(stderr,
  24. - _("Couldnt get a file descriptor referring to the console\n"));
  25. - return(2);
  26. - }
  27. - if (ioctl(consfd, VT_GETSTATE, &vtstat) < 0) {
  28. + if (consfd >= 0 && ioctl(consfd, VT_GETSTATE, &vtstat) < 0) {
  29. perror("openvt: VT_GETSTATE");
  30. return(4);
  31. }
  32. if (vtno == -1) {
  33. + if (consfd < 0) {
  34. + fprintf(stderr,
  35. + _("Couldnt get a file descriptor referring to the console\n"));
  36. + return(2);
  37. + }
  38. if ((ioctl(consfd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) {
  39. perror("openvt: VT_OPENQRY");
  40. fprintf(stderr, _("openvt: cannot find a free vt\n"));
  41. @@ -267,7 +267,7 @@
  42. if ( do_wait ) {
  43. wait(NULL);
  44. - if (show) { /* Switch back... */
  45. + if (show && consfd >= 0) { /* Switch back... */
  46. if (ioctl(consfd, VT_ACTIVATE, vtstat.v_active)) {
  47. perror("VT_ACTIVATE");
  48. return 8;