|
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/package/base/kbd/devpts.patch # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. A copy of the GNU General Public # License can be found at Documentation/COPYING. # # Many people helped and are helping developing ROCK Linux. Please # have a look at http://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END ---
--- ./openvt/openvt.c.orig 2003-08-16 16:44:04.000000000 +0300
+++ ./openvt/openvt.c 2003-08-16 16:42:01.000000000 +0300
@@ -100,18 +100,18 @@
} consfd = getfd(); - if (consfd < 0) {
- fprintf(stderr,
- _("Couldnt get a file descriptor referring to the console\n"));
- return(2);
- }
- if (ioctl(consfd, VT_GETSTATE, &vtstat) < 0) {
+ if (consfd >= 0 && ioctl(consfd, VT_GETSTATE, &vtstat) < 0) {
perror("openvt: VT_GETSTATE"); return(4); } if (vtno == -1) { + if (consfd < 0) {
+ fprintf(stderr,
+ _("Couldnt get a file descriptor referring to the console\n"));
+ return(2);
+ }
if ((ioctl(consfd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) { perror("openvt: VT_OPENQRY"); fprintf(stderr, _("openvt: cannot find a free vt\n")); @@ -267,7 +267,7 @@
if ( do_wait ) { wait(NULL); - if (show) { /* Switch back... */
+ if (show && consfd >= 0) { /* Switch back... */
if (ioctl(consfd, VT_ACTIVATE, vtstat.v_active)) { perror("VT_ACTIVATE"); return 8;
|