Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!std-unix From: guy@Sun.COM (Guy Harris) Newsgroups: comp.std.unix Subject: Re: open file range Message-ID: <8357@ut-sally.UUCP> Date: Sat, 20-Jun-87 15:45:02 EDT Article-I.D.: ut-sally.8357 Posted: Sat Jun 20 15:45:02 1987 Date-Received: Tue, 30-Jun-87 06:45:55 EDT Sender: std-unix@ut-sally.UUCP Reply-To: guy@Sun.COM (Guy Harris) Lines: 22 Approved: jsq@sally.utexas.edu (Moderator, John Quarterman) From: guy@Sun.COM (Guy Harris) > ...it would mean that things like > fd = open(some-random-filename,something); > do-something-bizarre-with-fd; > close(fd); > will do a "close(-1)" if the open happened to fail for some reason or other, > which is harmless at the moment (just returns -1, errno=EBADF), but would be > a bit tragic with this new semantics! > Yes, I know this isn't a problem if everyone always checks the return-value > from open(), creat(), etc..., but lots of programs aren't that pessimistic! Programs that are not that pessimistic are broken. I see no reason to reject this proposal out of hand merely because it would expose bugs in programs such as these; indeed, the fact that it exposes these bugs might be an excellent reason to do it - it is very aggravating to deal with programs that exhibit this sort of unwarranted optimism, as they do not give very good error indications when this optimism is unwarranted (if they bother giving one at all!). Volume-Number: Volume 11, Number 75