~lidaobing/+junk/zhcon

« back to all changes in this revision

Viewing changes to tools/gpm-1.19.6-pty.diff

  • Committer: LI Daobing
  • Date: 2008-11-04 04:39:18 UTC
  • Revision ID: lidaobing@gmail.com-20081104043918-nfwwvgfb0uied0mt
importĀ 1:0.2.6-5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -urN gpm-1.19.6/src/liblow.c gpm-1.19.6.new/src/liblow.c
 
2
--- gpm-1.19.6/src/liblow.c     Tue Oct  2 04:08:47 2001
 
3
+++ gpm-1.19.6.new/src/liblow.c Tue Apr 30 22:44:24 2002
 
4
@@ -243,6 +243,14 @@
 
5
           if (!t && isatty(1)) t = ttyname(1); /* stdout */
 
6
           if (!t && isatty(2)) t = ttyname(2); /* stderr */
 
7
           if (!t) goto err;
 
8
+
 
9
+          /* help api running in pty env, like zhcon*/
 
10
+         /* get salve tty name and try open */
 
11
+         if (!strncmp(t,"/dev/pts",8))
 
12
+            { /* for pty mode */
 
13
+              t = getenv("PTY_SLAVE"); /* get slave tty */
 
14
+              if (!t) goto err;
 
15
+            }
 
16
           strcpy(tty,t);
 
17
 
 
18
           /* replace with report() in gpm-1.21.x */