1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Changes from arch/CVS synchronization

This commit is contained in:
Ludovic Courtès 2007-12-04 17:57:44 +00:00
parent 7d1fc87217
commit 693758d5a8
4 changed files with 21 additions and 5 deletions

View file

@ -1,6 +1,6 @@
2007-12-04 Ludovic Courtès <ludo@gnu.org> 2007-12-04 Ludovic Courtès <ludo@gnu.org>
* NEWS: Mention `accept' bug fix. * NEWS: Mention `accept' and `scm_c_{read,write}' bug fixes.
2007-12-03 Ludovic Courtès <ludo@gnu.org> 2007-12-03 Ludovic Courtès <ludo@gnu.org>

1
NEWS
View file

@ -44,6 +44,7 @@ Changes in 1.8.4 (since 1.8.3)
** Fixed a segmentation fault which occurred when displaying the ** Fixed a segmentation fault which occurred when displaying the
backtrace of a stack with a promise object (made by `delay') in it. backtrace of a stack with a promise object (made by `delay') in it.
** Make `accept' leave guile mode while blocking ** Make `accept' leave guile mode while blocking
** `scm_c_read ()' and `scm_c_write ()' now type-check their port argument
* New modules (see the manual for details) * New modules (see the manual for details)

View file

@ -1,5 +1,8 @@
2007-12-04 Ludovic Courtès <ludo@gnu.org> 2007-12-04 Ludovic Courtès <ludo@gnu.org>
* ports.c (scm_c_read): Validate PORT as an open input port.
(scm_c_write): Validate PORT as an open output port.
* socket.c (scm_accept): Leave guile mode using * socket.c (scm_accept): Leave guile mode using
`scm_std_select ()' before calling `accept(2)'. Reported by `scm_std_select ()' before calling `accept(2)'. Reported by
dskr <dskr@mac.com>. dskr <dskr@mac.com>.

View file

@ -1069,10 +1069,14 @@ scm_lfwrite (const char *ptr, size_t size, SCM port)
size_t size_t
scm_c_read (SCM port, void *buffer, size_t size) scm_c_read (SCM port, void *buffer, size_t size)
#define FUNC_NAME "scm_c_read"
{ {
scm_t_port *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt;
size_t n_read = 0, n_available; size_t n_read = 0, n_available;
SCM_VALIDATE_OPINPORT (1, port);
pt = SCM_PTAB_ENTRY (port);
if (pt->rw_active == SCM_PORT_WRITE) if (pt->rw_active == SCM_PORT_WRITE)
scm_ptobs[SCM_PTOBNUM (port)].flush (port); scm_ptobs[SCM_PTOBNUM (port)].flush (port);
@ -1109,6 +1113,7 @@ scm_c_read (SCM port, void *buffer, size_t size)
return n_read + size; return n_read + size;
} }
#undef FUNC_NAME
/* scm_c_write /* scm_c_write
* *
@ -1120,11 +1125,17 @@ scm_c_read (SCM port, void *buffer, size_t size)
* Warning: Doesn't update port line and column counts! * Warning: Doesn't update port line and column counts!
*/ */
void void
scm_c_write (SCM port, const void *ptr, size_t size) scm_c_write (SCM port, const void *ptr, size_t size)
#define FUNC_NAME "scm_c_write"
{ {
scm_t_port *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt;
scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (port)]; scm_t_ptob_descriptor *ptob;
SCM_VALIDATE_OPOUTPORT (1, port);
pt = SCM_PTAB_ENTRY (port);
ptob = &scm_ptobs[SCM_PTOBNUM (port)];
if (pt->rw_active == SCM_PORT_READ) if (pt->rw_active == SCM_PORT_READ)
scm_end_input (port); scm_end_input (port);
@ -1134,6 +1145,7 @@ scm_c_write (SCM port, const void *ptr, size_t size)
if (pt->rw_random) if (pt->rw_random)
pt->rw_active = SCM_PORT_WRITE; pt->rw_active = SCM_PORT_WRITE;
} }
#undef FUNC_NAME
void void
scm_flush (SCM port) scm_flush (SCM port)