[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 38/47: Fix getsockopt/setsockopt handling of SO_SNDBUF/S
From: |
Andy Wingo |
Subject: |
[Guile-commits] 38/47: Fix getsockopt/setsockopt handling of SO_SNDBUF/SO_RCVBUF options. |
Date: |
Sun, 22 May 2016 18:23:06 +0000 (UTC) |
wingo pushed a commit to branch master
in repository guile.
commit 7d7e4bc6c0e9a109eafc68ae7e5494f6a1dcaab9
Author: Mark H Weaver <address@hidden>
Date: Fri Nov 13 11:38:13 2015 -0500
Fix getsockopt/setsockopt handling of SO_SNDBUF/SO_RCVBUF options.
Reported by Park SungMin <address@hidden>
in <https://lists.gnu.org/archive/html/guile-user/2015-11/msg00026.html>.
* libguile/socket.c (scm_getsockopt, scm_setsockopt): Remove code that
incorrectly assumed that the argument for SO_SNDBUF and SO_RCVBUF
options was of type 'size_t'. Both the Linux and POSIX documentation
indicates that the argument is of type 'int', as is the case for most
options.
---
libguile/socket.c | 30 ++----------------------------
1 file changed, 2 insertions(+), 28 deletions(-)
diff --git a/libguile/socket.c b/libguile/socket.c
index 2a9be54..a6f1e5f 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
- * 2006, 2007, 2009, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998, 2000-2007, 2009, 2011-2015
+ * Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -508,19 +508,7 @@ SCM_DEFINE (scm_getsockopt, "getsockopt", 3, 0, 0,
scm_from_int (0));
#endif
}
- else
#endif
- if (0
-#ifdef SO_SNDBUF
- || ioptname == SO_SNDBUF
-#endif
-#ifdef SO_RCVBUF
- || ioptname == SO_RCVBUF
-#endif
- )
- {
- return scm_from_size_t (*(size_t *) &optval);
- }
}
return scm_from_int (*(int *) &optval);
}
@@ -649,21 +637,7 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0,
optval = &opt_int;
#endif
}
- else
#endif
- if (0
-#ifdef SO_SNDBUF
- || ioptname == SO_SNDBUF
-#endif
-#ifdef SO_RCVBUF
- || ioptname == SO_RCVBUF
-#endif
- )
- {
- opt_int = scm_to_int (value);
- optlen = sizeof (size_t);
- optval = &opt_int;
- }
}
#ifdef HAVE_STRUCT_IP_MREQ
- [Guile-commits] 39/47: Bump user-visible copyright years to 2015., (continued)
- [Guile-commits] 39/47: Bump user-visible copyright years to 2015., Andy Wingo, 2016/05/22
- [Guile-commits] 43/47: SRFI-19: Update the table of leap seconds., Andy Wingo, 2016/05/22
- [Guile-commits] 41/47: http: Accept empty reason phrases., Andy Wingo, 2016/05/22
- [Guile-commits] 42/47: http: Use 'read-header-line' instead of 'read-line*'., Andy Wingo, 2016/05/22
- [Guile-commits] 47/47: Merge from stable-2.0, Andy Wingo, 2016/05/22
- [Guile-commits] 14/47: Fix typo in the man page., Andy Wingo, 2016/05/22
- [Guile-commits] 33/47: build: Remove libguile/mkstemp.c, redundant with Gnulib., Andy Wingo, 2016/05/22
- [Guile-commits] 37/47: Regenerate SRFI-14 character set data., Andy Wingo, 2016/05/22
- [Guile-commits] 34/47: Thank David and Kouhei., Andy Wingo, 2016/05/22
- [Guile-commits] 18/47: Heed the reader settings implied by #!r6rs, Andy Wingo, 2016/05/22
- [Guile-commits] 38/47: Fix getsockopt/setsockopt handling of SO_SNDBUF/SO_RCVBUF options.,
Andy Wingo <=
- [Guile-commits] 24/47: Thank Ricardo., Andy Wingo, 2016/05/22