From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <189c4857d117eea7ea4541c575794a4d.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199702181936.NAA09351@melanoma.uchicago.edu> Date: 18 Feb 1997 19:13:35 -0000 From: Eric Smith Subject: Re: fclose() Uncle George wrote: > actually my point wudda have been the the primitive os calls > open/close behave in predictable ways. The primitive OS calls open() and close() do behave in predictable ways. If you call close() on an FD that isn't open, it will return an error. fclose() isn't a primitive OS call. > the first close() I would get a return of 0; > the second close() I would, and expect a return of -1 with errno set. > I do not expect an system crash to happen. A system crash does not happen. The process is sent a signal and exits. > I expect fclose to give me an error return - something more gracefull than a > segfault. Fclose should know that the ptr is invalid - points to no open > channel - and give an appropiate error code. What's the point in checking the return code or errno for fclose()? What are you going to do if it fails, try to close it again, hoping that the error condition has been remedied? Print "Abort, Retry, Ignore?" to stderr? :-) Cheers, Eric -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com