home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sun / apps / 1682 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.7 KB

  1. Path: sparky!uunet!caen!uakari.primate.wisc.edu!doug.cae.wisc.edu!igor
  2. From: igor@cae.wisc.edu (Igor Khurgin)
  3. Newsgroups: comp.sys.sun.apps
  4. Subject: Contool bug
  5. Message-ID: <1992Aug21.145839.12542@doug.cae.wisc.edu>
  6. Date: 21 Aug 92 19:58:38 GMT
  7. Organization: College of Engineering, Univ. of Wisconsin-Madison
  8. Lines: 45
  9. Originator: igor@ws-39.cae.wisc.edu
  10.  
  11.  
  12. I found a bug in the contool-3.2b code for openwindows version 3.0.
  13. (the software is copyright 1987-92 by Chuck Musciano and Harris Corp.
  14.  it's a shareware.) The problem is that when they open pseudo-terminal
  15. in the function "open_psuedo_tty" (file misc.c) they forget to test
  16. the availability of the slave side of the pseudo-terminal if they found
  17. available master side. That sometimes causes the function to fail and
  18. therefore contool does not get created. Changed version of the function
  19. is provided below:
  20.  
  21.  
  22. EXPORT  char    *open_psuedo_tty(master, m_mode, slave, s_mode)
  23.  
  24. FILE    **master;
  25. char    *m_mode;
  26. FILE    **slave;
  27. char    *s_mode;
  28.  
  29. {       char    *s, *t;
  30.  
  31.         strcpy(path, PATH);
  32.         for (s = LETTERS; *s && *master == NULL; s++) {
  33.            path[L_POS] = *s;
  34.            for (t = DIGITS; *t && *master == NULL; t++) {
  35.               path[D_POS] = *t;
  36.               *master = fopen(path, m_mode);
  37.         if (*master != NULL) {
  38.            path[P_POS] = 't';
  39.            *slave = fopen(path, s_mode);
  40.            if(*slave == NULL) {
  41.               close(*master);
  42.               path[P_POS] = 'p';
  43.              }
  44.            else {
  45.              path[P_POS] = 'p';
  46.              goto out_label ;
  47.              }
  48.           }
  49.         }
  50.        }
  51. out_label:
  52.         return(path);
  53. }
  54.  
  55. If you more questions about this problem please mail: igor@cae.wisc.edu
  56.