Thu Jul 12 10:14:50 2012 UTC ()
Revert local patch adding a call to openpty.
Defining HAS_OPENPTY (which I just added in the crossover Makefile)
has the same effect.


(wiz)
diff -r1.3 -r1.4 xsrc/external/mit/xconsole/dist/xconsole.c

cvs diff -r1.3 -r1.4 xsrc/external/mit/xconsole/dist/xconsole.c (expand / switch to unified diff)

--- xsrc/external/mit/xconsole/dist/xconsole.c 2010/11/21 01:19:29 1.3
+++ xsrc/external/mit/xconsole/dist/xconsole.c 2012/07/12 10:14:50 1.4
@@ -902,56 +902,52 @@ get_pty(int *pty, int *tty, char *ttydev @@ -902,56 +902,52 @@ get_pty(int *pty, int *tty, char *ttydev
902 } 902 }
903 if (*pty >= 0) 903 if (*pty >= 0)
904 close (*pty); 904 close (*pty);
905 } 905 }
906#else /* !CRAY */ 906#else /* !CRAY */
907#ifdef sgi 907#ifdef sgi
908 { 908 {
909 char *slave; 909 char *slave;
910 slave = _getpty (pty, O_RDWR, 0622, 0); 910 slave = _getpty (pty, O_RDWR, 0622, 0);
911 if ((*tty = open (slave, O_RDWR)) != -1) 911 if ((*tty = open (slave, O_RDWR)) != -1)
912 return 0; 912 return 0;
913 } 913 }
914#else 914#else
915#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) 
916 return openpty(pty, tty, ttydev, NULL, NULL); 
917#else 
918 strcpy (ttydev, "/dev/ttyxx"); 915 strcpy (ttydev, "/dev/ttyxx");
919 strcpy (ptydev, "/dev/ptyxx"); 916 strcpy (ptydev, "/dev/ptyxx");
920 while (PTYCHAR1[letter]) { 917 while (PTYCHAR1[letter]) {
921 ttydev [strlen(ttydev) - 2] = ptydev [strlen(ptydev) - 2] = 918 ttydev [strlen(ttydev) - 2] = ptydev [strlen(ptydev) - 2] =
922 PTYCHAR1 [letter]; 919 PTYCHAR1 [letter];
923 920
924 while (PTYCHAR2[devindex]) { 921 while (PTYCHAR2[devindex]) {
925 ttydev [strlen(ttydev) - 1] = ptydev [strlen(ptydev) - 1] = 922 ttydev [strlen(ttydev) - 1] = ptydev [strlen(ptydev) - 1] =
926 PTYCHAR2 [devindex]; 923 PTYCHAR2 [devindex];
927 if ((*pty = open (ptydev, O_RDWR)) >= 0 && 924 if ((*pty = open (ptydev, O_RDWR)) >= 0 &&
928 (*tty = open (ttydev, O_RDWR)) >= 0) 925 (*tty = open (ttydev, O_RDWR)) >= 0)
929 { 926 {
930 /* 927 /*
931 * We need to set things up for our next entry 928 * We need to set things up for our next entry
932 * into this function! 929 * into this function!
933 */ 930 */
934 (void) devindex++; 931 (void) devindex++;
935 return(0); 932 return(0);
936 } 933 }
937 if (*pty >= 0) 934 if (*pty >= 0)
938 close (*pty); 935 close (*pty);
939 devindex++; 936 devindex++;
940 } 937 }
941 devindex = 0; 938 devindex = 0;
942 (void) letter++; 939 (void) letter++;
943 } 940 }
944#endif /* BSD4_4 else not BSD4_4 */ 
945#endif /* sgi else not sgi */ 941#endif /* sgi else not sgi */
946#endif /* CRAY else not CRAY */ 942#endif /* CRAY else not CRAY */
947#endif /* umips && SYSTYPE_SYSV */ 943#endif /* umips && SYSTYPE_SYSV */
948#endif /* USE_GET_PSEUDOTTY */ 944#endif /* USE_GET_PSEUDOTTY */
949#endif /* SVR4 */ 945#endif /* SVR4 */
950 /* 946 /*
951 * We were unable to allocate a pty master! Return an error 947 * We were unable to allocate a pty master! Return an error
952 * condition and let our caller terminate cleanly. 948 * condition and let our caller terminate cleanly.
953 */ 949 */
954 return(1); 950 return(1);
955} 951}
956#endif 952#endif
957 953