mirror of the now-defunct rocklinux.org
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.

58 lines
2.0 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/kbd/devpts.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. --- ./openvt/openvt.c.orig 2003-08-16 16:44:04.000000000 +0300
  23. +++ ./openvt/openvt.c 2003-08-16 16:42:01.000000000 +0300
  24. @@ -100,18 +100,18 @@
  25. }
  26. consfd = getfd();
  27. - if (consfd < 0) {
  28. - fprintf(stderr,
  29. - _("Couldnt get a file descriptor referring to the console\n"));
  30. - return(2);
  31. - }
  32. - if (ioctl(consfd, VT_GETSTATE, &vtstat) < 0) {
  33. + if (consfd >= 0 && ioctl(consfd, VT_GETSTATE, &vtstat) < 0) {
  34. perror("openvt: VT_GETSTATE");
  35. return(4);
  36. }
  37. if (vtno == -1) {
  38. + if (consfd < 0) {
  39. + fprintf(stderr,
  40. + _("Couldnt get a file descriptor referring to the console\n"));
  41. + return(2);
  42. + }
  43. if ((ioctl(consfd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) {
  44. perror("openvt: VT_OPENQRY");
  45. fprintf(stderr, _("openvt: cannot find a free vt\n"));
  46. @@ -267,7 +267,7 @@
  47. if ( do_wait ) {
  48. wait(NULL);
  49. - if (show) { /* Switch back... */
  50. + if (show && consfd >= 0) { /* Switch back... */
  51. if (ioctl(consfd, VT_ACTIVATE, vtstat.v_active)) {
  52. perror("VT_ACTIVATE");
  53. return 8;