mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-14 08:27:34 +02:00
Using ferror when possible in sexp_maybe_block_port.
This commit is contained in:
parent
28e75d50fe
commit
52781e59e0
1 changed files with 4 additions and 0 deletions
4
sexp.c
4
sexp.c
|
@ -1986,7 +1986,11 @@ int sexp_maybe_block_port (sexp ctx, sexp in, int forcep) {
|
||||||
if (sexp_port_flags(in) & O_NONBLOCK) {
|
if (sexp_port_flags(in) & O_NONBLOCK) {
|
||||||
if (!forcep
|
if (!forcep
|
||||||
&& (((c = sexp_read_char(ctx, in)) == EOF)
|
&& (((c = sexp_read_char(ctx, in)) == EOF)
|
||||||
|
#if SEXP_USE_STRING_STREAMS
|
||||||
|
&& (ferror(sexp_port_stream(in)) == EAGAIN)
|
||||||
|
#else
|
||||||
&& (errno == EAGAIN)
|
&& (errno == EAGAIN)
|
||||||
|
#endif
|
||||||
&& sexp_opcodep((f=sexp_global(ctx, SEXP_G_THREADS_BLOCKER))))) {
|
&& sexp_opcodep((f=sexp_global(ctx, SEXP_G_THREADS_BLOCKER))))) {
|
||||||
((sexp_proc2)sexp_opcode_func(f))(ctx sexp_api_pass(f, 1), in);
|
((sexp_proc2)sexp_opcode_func(f))(ctx sexp_api_pass(f, 1), in);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue