You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1160 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Je suis tombé sur ça:
revision 1.53
date: 2002/03/26 14:28:25; author: doligez; state: Exp; lines: +9 -2
ne pas lever d'exception si on flushe un channel ferme
La raison donnée est:
If the channel is closed, DO NOT raise a "bad file descriptor"
exception, but do nothing (the buffer is already empty). See
the "at_exit" line of stdlib/format.ml for a good reason to avoid
the exception.
*/
CAMLexport int flush_partial(struct channel *channel)
{
int towrite, written;
if (channel->fd == -1) return 1;
towrite = channel->curr - channel->buff;
J'ai eu exactement le même problème; en discutant avec Pierre, son
avis est que le programme est hors spec (il ne devrait pas fermer le
formateur standard).
Même si on estime que Format doit le flusher, je crois qu'il faut le
faire comme on flushe stdout/... par at_exit, i.e. en prenant garde de
ne pas flusher un canal déjà fermé. Le patch ci-dessus cache des bugs
utilisateur potentiels, alors que le problème est uniquement dans
Format.
Je propose donc de décommiter ce patch, et de faire une modification
dans Format, e.g. rattraper Sys_error autour de print_flush à l'appel
de at_exit (si c'est le plus simple).
Bruno.
The text was updated successfully, but these errors were encountered:
Original bug ID: 1160
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Je suis tombé sur ça:
revision 1.53
date: 2002/03/26 14:28:25; author: doligez; state: Exp; lines: +9 -2
ne pas lever d'exception si on flushe un channel ferme
La raison donnée est:
If the channel is closed, DO NOT raise a "bad file descriptor"
exception, but do nothing (the buffer is already empty). See
the "at_exit" line of stdlib/format.ml for a good reason to avoid
the exception.
*/
CAMLexport int flush_partial(struct channel *channel)
{
int towrite, written;
if (channel->fd == -1) return 1;
towrite = channel->curr - channel->buff;
J'ai eu exactement le même problème; en discutant avec Pierre, son
avis est que le programme est hors spec (il ne devrait pas fermer le
formateur standard).
Même si on estime que Format doit le flusher, je crois qu'il faut le
faire comme on flushe stdout/... par at_exit, i.e. en prenant garde de
ne pas flusher un canal déjà fermé. Le patch ci-dessus cache des bugs
utilisateur potentiels, alors que le problème est uniquement dans
Format.
Je propose donc de décommiter ce patch, et de faire une modification
dans Format, e.g. rattraper Sys_error autour de print_flush à l'appel
de at_exit (si c'est le plus simple).
Bruno.
The text was updated successfully, but these errors were encountered: