home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.11 / text0074.txt < prev    next >
Encoding:
Internet Message Format  |  1987-07-18  |  1018 b 

  1. From: guy@Sun.COM (Guy Harris)
  2.  
  3. > ...it would mean that things like
  4. >     fd = open(some-random-filename,something);
  5. >     do-something-bizarre-with-fd;
  6. >     close(fd);
  7. > will do a "close(-1)" if the open happened to fail for some reason or other,
  8. > which is harmless at the moment (just returns -1, errno=EBADF), but would be
  9. > a bit tragic with this new semantics!
  10. > Yes, I know this isn't a problem if everyone always checks the return-value
  11. > from open(), creat(), etc..., but lots of programs aren't that pessimistic!
  12.  
  13. Programs that are not that pessimistic are broken.  I see no reason
  14. to reject this proposal out of hand merely because it would expose
  15. bugs in programs such as these; indeed, the fact that it exposes
  16. these bugs might be an excellent reason to do it - it is very
  17. aggravating to deal with programs that exhibit this sort of unwarranted
  18. optimism, as they do not give very good error indications when this
  19. optimism is unwarranted (if they bother giving one at all!).
  20.  
  21.  
  22. Volume-Number: Volume 11, Number 75
  23.  
  24.