mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 01:30:27 +02:00
* fports.c (scm_fdes_to_port): call fcntl F_GETFL to test that
the fdes is valid before doing anything else. check that the file descriptor supports the modes required. (scm_fport_buffer_add): don't throw an error if fstat doesn't work: just use the default buffer size. * throw.c: change an outdated comment about scm_internal_catch BODY: it doesn't take a jumpbuf arg. * init.c (scm_standard_stream_to_port): install a handler in case scm_fdes_to_port throws an error. don't check here whether the file descriptor is valid, since scm_fdes_to_port will do that. set the revealed count depending on whether the port got the standard file descriptor. (stream_body_data): new type. (stream_body, stream_handler): new procs.
This commit is contained in:
parent
f8a72ca4c9
commit
19b27fa236
4 changed files with 85 additions and 37 deletions
|
@ -148,13 +148,11 @@ struct jmp_buf_and_retval /* use only on the stack, in scm_catch */
|
|||
|
||||
BODY is a pointer to a C function which runs the body of the catch;
|
||||
this is the code you can throw from. We call it like this:
|
||||
BODY (BODY_DATA, JMPBUF)
|
||||
BODY (BODY_DATA)
|
||||
where:
|
||||
BODY_DATA is just the BODY_DATA argument we received; we pass it
|
||||
through to BODY as its first argument. The caller can make
|
||||
BODY_DATA point to anything useful that BODY might need.
|
||||
JMPBUF is the Scheme jmpbuf object corresponding to this catch,
|
||||
which we have just created and initialized.
|
||||
|
||||
HANDLER is a pointer to a C function to deal with a throw to TAG,
|
||||
should one occur. We call it like this:
|
||||
|
@ -610,7 +608,6 @@ SCM_DEFINE (scm_throw, "throw", 1, 0, 1,
|
|||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
||||
SCM
|
||||
scm_ithrow (SCM key, SCM args, int noreturn)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue