home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!caen!uakari.primate.wisc.edu!doug.cae.wisc.edu!igor
- From: igor@cae.wisc.edu (Igor Khurgin)
- Newsgroups: comp.sys.sun.apps
- Subject: Contool bug
- Message-ID: <1992Aug21.145839.12542@doug.cae.wisc.edu>
- Date: 21 Aug 92 19:58:38 GMT
- Organization: College of Engineering, Univ. of Wisconsin-Madison
- Lines: 45
- Originator: igor@ws-39.cae.wisc.edu
-
-
- I found a bug in the contool-3.2b code for openwindows version 3.0.
- (the software is copyright 1987-92 by Chuck Musciano and Harris Corp.
- it's a shareware.) The problem is that when they open pseudo-terminal
- in the function "open_psuedo_tty" (file misc.c) they forget to test
- the availability of the slave side of the pseudo-terminal if they found
- available master side. That sometimes causes the function to fail and
- therefore contool does not get created. Changed version of the function
- is provided below:
-
-
- EXPORT char *open_psuedo_tty(master, m_mode, slave, s_mode)
-
- FILE **master;
- char *m_mode;
- FILE **slave;
- char *s_mode;
-
- { char *s, *t;
-
- strcpy(path, PATH);
- for (s = LETTERS; *s && *master == NULL; s++) {
- path[L_POS] = *s;
- for (t = DIGITS; *t && *master == NULL; t++) {
- path[D_POS] = *t;
- *master = fopen(path, m_mode);
- if (*master != NULL) {
- path[P_POS] = 't';
- *slave = fopen(path, s_mode);
- if(*slave == NULL) {
- close(*master);
- path[P_POS] = 'p';
- }
- else {
- path[P_POS] = 'p';
- goto out_label ;
- }
- }
- }
- }
- out_label:
- return(path);
- }
-
- If you more questions about this problem please mail: igor@cae.wisc.edu
-