www.nico.schottelius.org/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3

22 lines
935 B
Groff
Raw Normal View History

--- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000
+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000
@@ -249,7 +249,7 @@
gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM);
memcpy(tty, consolename, strlen(consolename)-1);
sprintf(&tty[strlen(consolename) - 1], "%i", flag);
- } else { /* use your current vc */
+ } else if (flag==0) { /* use your current vc */
if (isatty(0)) tty = ttyname(0); /* stdin */
if (!tty && isatty(1)) tty = ttyname(1); /* stdout */
if (!tty && isatty(2)) tty = ttyname(2); /* stderr */
@@ -259,7 +259,8 @@
}
conn->vc=atoi(&tty[strlen(consolename)-1]);
- }
+ } else /* a default handler -- use console */
+ tty=strdup(consolename);
if (gpm_consolefd == -1)
if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) {