Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Eric Smith <eric@brouhaha.com>
Subject: Re: fclose()
Date: 18 Feb 1997 19:13:35 -0000	[thread overview]
Message-ID: <189c4857d117eea7ea4541c575794a4d.axp-list@archive.invalid> (raw)

Uncle George <gatgul@voicenet.com> 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

             reply	other threads:[~1997-02-18 19:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-18 19:13 Eric Smith [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-02-25 10:03 fclose() Uncle George
1997-02-25  9:52 fclose() Uncle George
     [not found] <eric@brouhaha.com>
1997-02-25  4:08 ` fclose() Bryan W. Headley
1997-02-24 21:17 fclose() Craig Burley
1997-02-24 19:41 fclose() Eric Smith
     [not found] <33119E2E.7313@voicenet.com>
1997-02-24 19:34 ` fclose() Richard Henderson
1997-02-24 13:57 fclose() Uncle George
     [not found] <330AFE32.5C6E@voicenet.com>
1997-02-19 14:49 ` fclose() Richard Henderson
1997-02-19 17:45 ` fclose() Philip Blundell
1997-02-19 13:20 fclose() Uncle George
     [not found] <19970218191335.5758.qmail@brouhaha.com>
1997-02-18 22:32 ` fclose() D. Champion
1997-02-18 19:11 fclose() Mark Hamstra
1997-02-18 18:06 fclose() Uncle George
     [not found] <3309BA67.2168@voicenet.com>
1997-02-18 16:04 ` fclose() Richard Henderson
1997-02-18 14:19 fclose() Uncle George
     [not found] <richard@atheist.tamu.edu>
1997-02-17 19:47 ` fclose() Bryan W. Headley
1997-02-17 20:04   ` fclose() Richard Henderson
     [not found] <33088AF0.2FF1@voicenet.com>
1997-02-17 19:01 ` fclose() Richard Henderson
1997-02-17 16:44 fclose() Uncle George
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox