home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / bsd / 4322 < prev    next >
Encoding:
Text File  |  1992-08-17  |  1.8 KB  |  58 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!psych!robert
  3. From: robert@psych.psy.uq.oz.au (Robert Dal Santo)
  4. Subject: Bug in /usr/include/sys/tty.h (+ PATCH)
  5. Message-ID: <1992Aug18.061135.3464@psych.psy.uq.oz.au>
  6. Keywords: kernel tty patch
  7. Organization: Psychology Department, University of Queensland
  8. Date: Tue, 18 Aug 1992 06:11:35 GMT
  9. Lines: 47
  10.  
  11. (Posted for a friend.  I will pass on mail messages.)
  12.  
  13.  
  14. I haven't seen this one in any FAQ or unofficial bug list, so here is my
  15. chance at World Fame and Everlasting Immortality...
  16.  
  17.  
  18. The bug:
  19.  
  20. The RB_LEN() macro in /usr/include/sys/tty.h is sometimes out by 1.  In
  21. particular, in the case of a buffer containing a single character at the
  22. very end, RB_LEN() would return 0.  This caused ttread() to block until
  23. a 2nd character was read before delivering them both.  The user would find
  24. RAW mode programs such as vi would occasionally (1 in 1024 keypresses)
  25. get "stuck" requiring a second keypress to bring it to life.
  26.  
  27.  
  28. The fix:
  29.  
  30. *** /tmp/,RCSt1000159    Mon Aug 17 13:05:17 1992
  31. --- tty.h    Thu Aug 13 14:07:03 1992
  32. ***************
  33. *** 59,65 ****
  34.   
  35.   #define    RB_LEN(rp) \
  36.           ((rp)->rb_hd <= (rp)->rb_tl ? (rp)->rb_tl - (rp)->rb_hd : \
  37. !         RBSZ - 1 - ((rp)->rb_hd - (rp)->rb_tl))
  38.   
  39.   #define    RB_CONTIGPUT(rp) \
  40.           (RB_PRED(rp, (rp)->rb_hd) < (rp)->rb_tl ?  \
  41. --- 59,65 ----
  42.   
  43.   #define    RB_LEN(rp) \
  44.           ((rp)->rb_hd <= (rp)->rb_tl ? (rp)->rb_tl - (rp)->rb_hd : \
  45. !         RBSZ - ((rp)->rb_hd - (rp)->rb_tl))
  46.   
  47.   #define    RB_CONTIGPUT(rp) \
  48.           (RB_PRED(rp, (rp)->rb_hd) < (rp)->rb_tl ?  \
  49.  
  50.  
  51. The thank-you:
  52.  
  53. Well done Lynne and William, and all helpers.  My life is changed for the
  54. better!  Similar thanks to those who made NET/2 BSD in the first place.
  55.  
  56.  
  57. Stephen McKay  Now safely back in BSD land after 4 savage years with System V.
  58.