mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 20:30:28 +02:00
Changes from arch/CVS synchronization
This commit is contained in:
parent
8e0ea2987d
commit
a23c67bcef
4 changed files with 28 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2007-12-04 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
|
||||||
|
* NEWS: Mention `accept' bug fix.
|
||||||
|
|
||||||
2007-12-03 Ludovic Courtès <ludo@gnu.org>
|
2007-12-03 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
|
||||||
* NEWS: Add SRFI-69.
|
* NEWS: Add SRFI-69.
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -12,6 +12,7 @@ Changes in 1.8.4 (since 1.8.3)
|
||||||
** CR (ASCII 0x0d) is (again) recognized as a token delimiter by the reader
|
** CR (ASCII 0x0d) is (again) recognized as a token delimiter by the reader
|
||||||
** 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
|
||||||
|
|
||||||
* New modules (see the manual for details)
|
* New modules (see the manual for details)
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2007-12-04 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
|
||||||
|
* socket.c (scm_accept): Leave guile mode using
|
||||||
|
`scm_std_select ()' before calling `accept(2)'. Reported by
|
||||||
|
dskr <dskr@mac.com>.
|
||||||
|
|
||||||
2007-10-19 Neil Jerram <neil@ossau.uklinux.net>
|
2007-10-19 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
* eval.c (unmemoize_delay): Extend the environment before
|
* eval.c (unmemoize_delay): Extend the environment before
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#include "libguile/validate.h"
|
#include "libguile/validate.h"
|
||||||
#include "libguile/socket.h"
|
#include "libguile/socket.h"
|
||||||
|
|
||||||
|
#include "libguile/iselect.h"
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
#include "win32-socket.h"
|
#include "win32-socket.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1321,16 +1323,30 @@ SCM_DEFINE (scm_accept, "accept", 1, 0, 0,
|
||||||
"connection and will continue to accept new requests.")
|
"connection and will continue to accept new requests.")
|
||||||
#define FUNC_NAME s_scm_accept
|
#define FUNC_NAME s_scm_accept
|
||||||
{
|
{
|
||||||
int fd;
|
int fd, selected;
|
||||||
int newfd;
|
int newfd;
|
||||||
SCM address;
|
SCM address;
|
||||||
SCM newsock;
|
SCM newsock;
|
||||||
|
SELECT_TYPE readfds, exceptfds;
|
||||||
socklen_t addr_size = MAX_ADDR_SIZE;
|
socklen_t addr_size = MAX_ADDR_SIZE;
|
||||||
scm_t_max_sockaddr addr;
|
scm_t_max_sockaddr addr;
|
||||||
|
|
||||||
sock = SCM_COERCE_OUTPORT (sock);
|
sock = SCM_COERCE_OUTPORT (sock);
|
||||||
SCM_VALIDATE_OPFPORT (1, sock);
|
SCM_VALIDATE_OPFPORT (1, sock);
|
||||||
fd = SCM_FPORT_FDES (sock);
|
fd = SCM_FPORT_FDES (sock);
|
||||||
|
|
||||||
|
FD_ZERO (&readfds);
|
||||||
|
FD_ZERO (&exceptfds);
|
||||||
|
FD_SET (fd, &readfds);
|
||||||
|
FD_SET (fd, &exceptfds);
|
||||||
|
|
||||||
|
/* Block until something happens on FD, leaving guile mode while
|
||||||
|
waiting. */
|
||||||
|
selected = scm_std_select (fd + 1, &readfds, NULL, &exceptfds,
|
||||||
|
NULL);
|
||||||
|
if (selected < 0)
|
||||||
|
SCM_SYSERROR;
|
||||||
|
|
||||||
newfd = accept (fd, (struct sockaddr *) &addr, &addr_size);
|
newfd = accept (fd, (struct sockaddr *) &addr, &addr_size);
|
||||||
if (newfd == -1)
|
if (newfd == -1)
|
||||||
SCM_SYSERROR;
|
SCM_SYSERROR;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue