Index: io_3_2.ml =================================================================== RCS file: /net/pauillac/caml/repository/cash/io_3_2.ml,v retrieving revision 1.47 retrieving revision 1.48 diff -c -a -r1.47 -r1.48 *** io_3_2.ml 2002/08/05 17:07:37 1.47 --- io_3_2.ml 2002/12/05 17:37:52 1.48 *************** *** 116,126 **** Some fd -> let res = low_close_fd fd in (* low_close_fd will tell it. *) do { ! close_any any_chan; (* Never raise exception in the current implementation. *) res } ] in (fun ichan -> close (anychan_of_ichan ichan), fun ochan -> do { flush ochan; close (anychan_of_ochan ochan) }) ; --- 116,129 ---- Some fd -> let res = low_close_fd fd in (* low_close_fd will tell it. *) do { ! (* Used to raise no exception, but this varies between implementations... *) ! try close_any any_chan with [ Sys_error "Bad file descriptor" -> () ]; res } ] in (fun ichan -> close (anychan_of_ichan ichan), + (* Current religion says: flush do nothing on a closed channel. *) + (* Current implication is: if an unflushed channel's fd is closed, it's an error. *) fun ochan -> do { flush ochan; close (anychan_of_ochan ochan) }) ;