Path: utzoo!attcan!uunet!ns-mx!ceres!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!sun-barr!ccut!titcca!kddlab!atrpost!atr-la!alain From: alain@atr-la.atr.co.jp (Alain de Cheveigne) Newsgroups: comp.sys.mac.programmer Subject: Re: FSRead hangs on the serial driver Message-ID: <3916@atr-la.atr.co.jp> Date: 12 Jan 90 00:43:43 GMT References: <7770@unix.SRI.COM> <4713@hydra.gatech.EDU <6113@internal.Apple.COM> <3915@atr-la.atr.co.jp> Organization: ATR International,Japan Lines: 27 In-reply-to: alain@atr-la.atr.co.jp's message of 11 Jan 90 08:24:59 GMT In article <3915@atr-la.atr.co.jp>, alain@atr-la.atr.co.jp (Alain de Cheveigne) writes: >In article <6113@internal.Apple.COM>, chesley@goofy.apple.com (Harry >Chesley)writes: [...] >>You can increase the buffer size by calling SerSetBuf (but be sure >>and unset the buffer by calling SerSetBuf with a length of zero before >>exiting the application or you'll get horrible crashes). > >I currently use a 8172 byte buffer, and I don't unset the buffer on >exit. I have never witnessed such a crash. Second thoughts on that. It is definitely a good idea *not* to leave the buffer set to a piece of program memory on exit! Thanks to Harry for finding a bug lurking in my program from the start. As Dijkstra says, it may be easy to prove that a program is buggy, but no amount of testing can prove that it ain't :-(. I suppose that, if the driver is closed on exit, the buffer gets reset to default the next time the driver is opened. But this wouldn't be the case if the driver was left open. By the way, no one answered a previous question of mine: is it ok to leave the driver open on exit? Alain de Cheveigne, alain@atr-la.atr.co.jp