projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6ab072
)
Mark channel closed before interrupting in Unix's OS_channel_closed.
author
Taylor R Campbell
<campbell@mumble.net>
Tue, 13 Dec 2011 07:40:37 +0000
(07:40 +0000)
committer
Taylor R Campbell
<campbell@mumble.net>
Tue, 13 Dec 2011 07:40:37 +0000
(07:40 +0000)
Interruption may restart the primitive that called it, which will
choke on a bad file descriptor.
src/microcode/uxio.c
patch
|
blob
|
history
diff --git
a/src/microcode/uxio.c
b/src/microcode/uxio.c
index 353620709e48825e428cfbc32559a316760d4bb2..729f009f3ae74475fa958809e673f42fa8685ff4 100644
(file)
--- a/
src/microcode/uxio.c
+++ b/
src/microcode/uxio.c
@@
-124,13
+124,14
@@
OS_channel_close (Tchannel channel)
{
if (! (CHANNEL_INTERNAL (channel)))
{
- if (0 > (UX_close (CHANNEL_DESCRIPTOR (channel))))
+ int status = (UX_close (CHANNEL_DESCRIPTOR (channel)));
+ MARK_CHANNEL_CLOSED (channel);
+ if (status < 0)
switch (errno)
{
case EINTR: deliver_pending_interrupts (); break;
case EBADF: error_system_call (errno, syscall_close); break;
}
- MARK_CHANNEL_CLOSED (channel);
}
}