diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-12-10 23:14:10 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-12-10 23:41:06 +0100 |
commit | cc948107089bf9a8aee25f33f46c8b1dfa914ae6 (patch) | |
tree | 3af8f03c67ec85f077f2de5e9f7ef3f74dc91472 /libguile/socket.c | |
parent | 4578dc947922d79cf7ffd937c46ae6bd261ef6a4 (diff) | |
download | guile-cc948107089bf9a8aee25f33f46c8b1dfa914ae6.tar.gz |
Verify the value of `SHUT_RD' and related constants.
* libguile/socket.c: Add `verify' clauses for the values of `SHUT_RD',
`SHUT_WR', and `SHUT_RDWR'.
Diffstat (limited to 'libguile/socket.c')
-rw-r--r-- | libguile/socket.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libguile/socket.c b/libguile/socket.c index 23143779a..5119ce3c6 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 Free Software Foundation, Inc. + * 2006, 2007, 2009, 2011, 2012 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 @@ -26,6 +26,7 @@ #include <errno.h> #include <gmp.h> +#include <verify.h> #include "libguile/_scm.h" #include "libguile/arrays.h" @@ -742,6 +743,11 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0, } #undef FUNC_NAME +/* Our documentation hard-codes this mapping, so make sure it holds. */ +verify (SHUT_RD == 0); +verify (SHUT_WR == 1); +verify (SHUT_RDWR == 2); + SCM_DEFINE (scm_shutdown, "shutdown", 2, 0, 0, (SCM sock, SCM how), "Sockets can be closed simply by using @code{close-port}. The\n" |