[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/23: setsockopt can take an fd
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/23: setsockopt can take an fd |
Date: |
Thu, 24 Mar 2016 14:26:03 +0000 |
wingo pushed a commit to branch wip-ethreads
in repository guile.
commit 785f93b5bbea4cfd42796defbae6dcc106a03652
Author: Andy Wingo <address@hidden>
Date: Sun Mar 18 17:03:27 2012 +0100
setsockopt can take an fd
* libguile/socket.c (scm_setsockopt): Accept a raw FD in addition to
file ports.
---
libguile/socket.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/libguile/socket.c b/libguile/socket.c
index 2a9be54..d886105 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -621,13 +621,17 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0,
int ilevel, ioptname;
- sock = SCM_COERCE_OUTPORT (sock);
+ if (scm_is_integer (sock))
+ fd = scm_to_int (sock);
+ else
+ {
+ sock = SCM_COERCE_OUTPORT (sock);
+ SCM_VALIDATE_OPFPORT (1, sock);
+ fd = SCM_FPORT_FDES (sock);
+ }
- SCM_VALIDATE_OPFPORT (1, sock);
ilevel = scm_to_int (level);
ioptname = scm_to_int (optname);
-
- fd = SCM_FPORT_FDES (sock);
if (ilevel == SOL_SOCKET)
{
- [Guile-commits] branch wip-ethreads created (now 4dc952f), Andy Wingo, 2016/03/24
- [Guile-commits] 04/23: add (ice-9 ethreads), Andy Wingo, 2016/03/24
- [Guile-commits] 09/23: eports: some more exports, Andy Wingo, 2016/03/24
- [Guile-commits] 12/23: (web server ethreads): Use a large backlog., Andy Wingo, 2016/03/24
- [Guile-commits] 13/23: add latin1 chars and strings to eports, Andy Wingo, 2016/03/24
- [Guile-commits] 18/23: (web server ethreads) TCP_NODELAY tweak, Andy Wingo, 2016/03/24
- [Guile-commits] 05/23: http: allow custom read-line / continuation-line? functions, Andy Wingo, 2016/03/24
- [Guile-commits] 06/23: setsockopt can take an fd,
Andy Wingo <=
- [Guile-commits] 10/23: EOF fix for continuation-line?, Andy Wingo, 2016/03/24
- [Guile-commits] 19/23: nio: add non-blocking connect, Andy Wingo, 2016/03/24
- [Guile-commits] 08/23: add #:limit to get-bytevector-delimited, Andy Wingo, 2016/03/24
- [Guile-commits] 11/23: socket: TCP_CORK, TCP_NODELAY, Andy Wingo, 2016/03/24
- [Guile-commits] 23/23: virtualize read/write/close operations in <eport>, Andy Wingo, 2016/03/24
- [Guile-commits] 15/23: (web server ethreads): more use of latin1 accessors, Andy Wingo, 2016/03/24
- [Guile-commits] 01/23: add (ice-9 nio), Andy Wingo, 2016/03/24
- [Guile-commits] 20/23: eports: nonblocking connect-eport, Andy Wingo, 2016/03/24
- [Guile-commits] 14/23: refactoring to (web server ethreads) read-http-line, Andy Wingo, 2016/03/24
- [Guile-commits] 02/23: add (ice-9 eports), Andy Wingo, 2016/03/24