Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e/s sur canaux ferme's #2673

Closed
vicuna opened this issue Feb 1, 2001 · 1 comment
Closed

e/s sur canaux ferme's #2673

vicuna opened this issue Feb 1, 2001 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 1, 2001

Original bug ID: 272
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Pour détecter de suite les entrées/sorties sur les canaux fermés, je
propose ce patch, qui provoque un refill ou un flush_partial dès la
1ère tentative d'accès au buffer après close, donc une
Uncaught exception: Sys_error "Bad file number".
Les numéros de lignes sont faux, j'ai d'autres modifications dans ma
version d'io.c (pour plus tard..).

Bruno.

Index: io.c

RCS file: /caml/ocaml/byterun/io.c,v
retrieving revision 1.43
diff -C6 -r1.43 io.c
*** io.c 2000/10/12 18:05:40 1.43
--- io.c 2001/02/01 13:40:38
*** 415,426 ****
--- 433,445 ----
value caml_close_channel(value vchannel) /* ML /
{
/
For output channels, must have flushed before */
struct channel * channel = Channel(vchannel);
close(channel->fd);
channel->fd = -1;

  • channel->curr = channel->max = channel->end;
    return Val_unit;
    }

value caml_channel_size(value vchannel) /* ML */
{
return Val_long(channel_size(Channel(vchannel)));

@vicuna
Copy link
Author

vicuna commented Feb 5, 2001

Comment author: administrator

Suggested improvement merged in 2000-02-05 by Xavier.

@vicuna vicuna closed this as completed Feb 5, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant