diff options
author | Steve Langasek <vorlon@debian.org> | 2004-12-07 23:23:48 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:28 -0800 |
commit | 37f2f5e0bb11a18deecf48c7ad6bcbf7bd932db2 (patch) | |
tree | 692caebb60ec5f80ce528a403b69351ca756d530 /socket.c | |
parent | e21d47d7813159bb71e0671df9b52ec0470c358d (diff) | |
parent | c7d035ae1a729232579a0fe41ed5affa131d3623 (diff) | |
download | scm-37f2f5e0bb11a18deecf48c7ad6bcbf7bd932db2.tar.gz scm-37f2f5e0bb11a18deecf48c7ad6bcbf7bd932db2.zip |
Import Debian changes 5d9-4.1debian/5d9-4.1
scm (5d9-4.1) unstable; urgency=high
* Non-maintainer upload.
* High-urgency upload for sarge-targetted RC bugfix.
* Revert upstream "CAUTIOUS" define, which causes the scm build to
fail its test suite on alpha (and, it appears, powerpc as well).
Closes: #245810.
scm (5d9-4) unstable; urgency=low
* Apply patch from 144062 to fix hppa build (Closes: #144062)
* Change scm.1 section from Jan 4 200 to 1. (lintian)
scm (5d9-3) unstable; urgency=low
* Properly clean up info files.
* Make and install Xlibscm.info.
scm (5d9-2) unstable; urgency=low
* Fix path problem in slibcat. Hack at mklibcat.scm. (Closes: #241510)
scm (5d9-1) unstable; urgency=low
* New upstream release
* Merge NMU sparc changes (Closes: #191171, #191356)
* SHORT_INT is defined for ia64 upstream (Closes: #141928)
* Scheme imps now grouped in info file (has been for a while)
(Closes: #115452)
Diffstat (limited to 'socket.c')
-rw-r--r-- | socket.c | 64 |
1 files changed, 33 insertions, 31 deletions
@@ -48,8 +48,8 @@ #include "scm.h" #ifdef macintosh -#define SOCKETDEFS -#include "macsocket.h" +# define SOCKETDEFS +# include "macsocket.h" #endif #include <sys/types.h> @@ -72,6 +72,9 @@ # ifdef __OpenBSD__ # include <unistd.h> # endif +# ifdef __NetBSD__ +# include <unistd.h> +# endif #endif /* STDC_HEADERS */ static char s_inetaddr[] = "inet:string->address"; @@ -79,7 +82,7 @@ SCM l_inetaddr (host) SCM host; { struct in_addr soka; - ASSERT(NIMP(host) && STRINGP(host), host, ARG1, s_inetaddr); + ASRTER(NIMP(host) && STRINGP(host), host, ARG1, s_inetaddr); soka.s_addr = inet_addr(CHARS(host)); if (-1==soka.s_addr) { struct hostent *entry; @@ -247,15 +250,15 @@ SCM l_servinfo(args) } name = CAR(args); proto = CDR(args); - ASSERT(NIMP(proto) && CONSP(proto), args, WNA, s_servinfo); + ASRTER(NIMP(proto) && CONSP(proto), args, WNA, s_servinfo); proto = CAR(proto); - ASSERT(NIMP(proto) && STRINGP(proto), args, ARG2, s_servinfo); + ASRTER(NIMP(proto) && STRINGP(proto), args, ARG2, s_servinfo); DEFER_INTS; if (NIMP(name) && STRINGP(name)) { SYSCALL(entry = getservbyname(CHARS(name), CHARS(proto));); } else { - ASSERT(INUMP(proto), proto, ARG1, s_servinfo); + ASRTER(INUMP(proto), proto, ARG1, s_servinfo); SYSCALL(entry = getservbyport(INUM(proto), CHARS(proto));); } comlab: ALLOW_INTS; @@ -303,9 +306,9 @@ SCM l_socket(fam, proto) int sd, j, tp = INUM(fam); FILE* f; SCM port; - ASSERT(INUMP(fam), fam, ARG1, s_socket); + ASRTER(INUMP(fam), fam, ARG1, s_socket); if UNBNDP(proto) proto = INUM0; - else ASSERT(INUMP(proto), proto, ARG2, s_socket); + else ASRTER(INUMP(proto), proto, ARG2, s_socket); NEWCELL(port); DEFER_INTS; SYSCALL(sd = socket(tp, SOCK_STREAM, INUM(proto));); @@ -326,7 +329,7 @@ SCM l_socket(fam, proto) #else sd = setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &j, sizeof(j)); #endif - ASSERT(!sd, port, "could not set socket option", s_socket); + ASRTER(!sd, port, "could not set socket option", s_socket); } return port; } @@ -338,9 +341,9 @@ SCM l_socketpair(fam, proto) int sv[2]; FILE* f[2]; SCM port[2]; - ASSERT(INUMP(fam), fam, ARG1, s_socketpair); + ASRTER(INUMP(fam), fam, ARG1, s_socketpair); if UNBNDP(proto) proto = INUM0; - else ASSERT(INUMP(proto), proto, ARG2, s_socketpair); + else ASRTER(INUMP(proto), proto, ARG2, s_socketpair); NEWCELL(port[0]); NEWCELL(port[1]); DEFER_INTS; SYSCALL(sts = socketpair(tp, SOCK_STREAM, INUM(proto), sv);); @@ -368,8 +371,8 @@ SCM l_shutdown(port, how) SCM port, how; { int sts; - ASSERT(NIMP(port) && OPFPORTP(port), port, ARG1, s_shutdown); - ASSERT(INUMP(how) && 0 <= INUM(how) && 2 >= INUM(how), + ASRTER(NIMP(port) && OPFPORTP(port), port, ARG1, s_shutdown); + ASRTER(INUMP(how) && 0 <= INUM(how) && 2 >= INUM(how), how, ARG2, s_shutdown); SYSCALL(sts = shutdown(fileno(STREAM(port)), INUM(how));); if (sts) return BOOL_F; @@ -390,14 +393,14 @@ SCM l_connect (sockpt, address, arg) { long flags; int sts; - ASSERT(NIMP(sockpt) && SOCKP(sockpt), sockpt, ARG1, s_connect); + ASRTER(NIMP(sockpt) && SOCKP(sockpt), sockpt, ARG1, s_connect); switch SOCKTYP(sockpt) { default: - ASSERT(0, sockpt, s_unkfam, s_connect); + ASRTER(0, sockpt, s_unkfam, s_connect); case AF_INET: - ASSERT(NIMP(arg) && CONSP(arg) && NULLP(CDR(arg)), arg, WNA, s_connect); + ASRTER(NIMP(arg) && CONSP(arg) && NULLP(CDR(arg)), arg, WNA, s_connect); arg = CAR(arg); - ASSERT(INUMP(arg), arg, ARG3, s_connect); + ASRTER(INUMP(arg), arg, ARG3, s_connect); { struct sockaddr_in soka; soka.sin_addr.s_addr = @@ -409,8 +412,8 @@ SCM l_connect (sockpt, address, arg) } break; case AF_UNIX: - ASSERT(NULLP(arg), arg, WNA, s_connect); - ASSERT(NIMP(address) && STRINGP(address), address, ARG2, s_connect); + ASRTER(NULLP(arg), arg, WNA, s_connect); + ASRTER(NIMP(address) && STRINGP(address), address, ARG2, s_connect); { struct sockaddr_un soka; soka.sun_family = AF_UNIX; @@ -433,12 +436,12 @@ SCM l_bind(sockpt, address) SCM sockpt, address; { int sts; - ASSERT(NIMP(sockpt) && SOCKP(sockpt), sockpt, ARG1, s_bind); + ASRTER(NIMP(sockpt) && SOCKP(sockpt), sockpt, ARG1, s_bind); switch SOCKTYP(sockpt) { default: - ASSERT(0, sockpt, s_unkfam, s_bind); + ASRTER(0, sockpt, s_unkfam, s_bind); case AF_UNIX: - ASSERT(NIMP(address) && STRINGP(address), address, ARG2, s_bind); + ASRTER(NIMP(address) && STRINGP(address), address, ARG2, s_bind); { struct sockaddr_un sa_server; bzero((char *) &sa_server, sizeof(sa_server)); @@ -449,7 +452,7 @@ SCM l_bind(sockpt, address) } break; case AF_INET: - ASSERT(INUMP(address), address, ARG2, s_bind); + ASRTER(INUMP(address), address, ARG2, s_bind); { struct sockaddr_in sa_server; bzero((char *) &sa_server, sizeof(sa_server)); @@ -470,8 +473,8 @@ SCM l_listen(port, backlog) { long flags; int sts; - ASSERT(NIMP(port) && SOCKP(port), port, ARG1, s_listen); - ASSERT(INUMP(backlog), backlog, ARG2, s_listen); + ASRTER(NIMP(port) && SOCKP(port), port, ARG1, s_listen); + ASRTER(INUMP(backlog), backlog, ARG2, s_listen); SYSCALL(sts = listen(fileno(STREAM(port)), INUM(backlog));); if (sts) return BOOL_F; DEFER_INTS; @@ -491,7 +494,7 @@ SCM l_accept(sockpt) FILE *newfd; SCM newpt; NEWCELL(newpt); - ASSERT(NIMP(sockpt) && OPINPORTP(sockpt), sockpt, ARG1, s_accept); + ASRTER(NIMP(sockpt) && OPINPORTP(sockpt), sockpt, ARG1, s_accept); sadlen=sizeof(sad); SYSCALL(newsd = accept(fileno(STREAM(sockpt)), &sad, &sadlen);); if (-1==newsd) { @@ -548,7 +551,7 @@ char s_sknm_family[] = "socket-name:family"; SCM l_sknm_family(snm) SCM snm; { - ASSERT(NIMP(snm) && TYP16(snm)==tc16_sknm, snm, ARG1, s_sknm_family); + ASRTER(NIMP(snm) && TYP16(snm)==tc16_sknm, snm, ARG1, s_sknm_family); return MAKINUM(((struct sockaddr *)CDR(snm))->sa_family + 0L); } char s_sknm_port_num[] = "socket-name:port-number"; @@ -600,11 +603,11 @@ SCM l_getpeername(sockpt) struct sockaddr_in sad; int sts, sadlen = sizeof(sad); bzero((char *) &sad, sizeof(sad)); - ASSERT(NIMP(sockpt) && OPFPORTP(sockpt), sockpt, ARG1, s_getpeername); + ASRTER(NIMP(sockpt) && OPFPORTP(sockpt), sockpt, ARG1, s_getpeername); SYSCALL(sts = getpeername(fileno(STREAM(sockpt)), (struct sockaddr*)&sad, &sadlen);); if (sts || sizeof(sad) != sadlen) return BOOL_F; -/* ASSERT(sad.sin_family==AF_INET, sockpt, "non-internet", s_getpeername); */ +/* ASRTER(sad.sin_family==AF_INET, sockpt, "non-internet", s_getpeername); */ return maksknm(&sad); } static char s_getsockname[] = "getsockname"; @@ -614,7 +617,7 @@ SCM l_getsockname(sockpt) struct sockaddr_in sad; int sts, sadlen = sizeof(sad); bzero((char *) &sad, sizeof(sad)); - ASSERT(NIMP(sockpt) && OPFPORTP(sockpt), sockpt, ARG1, s_getsockname); + ASRTER(NIMP(sockpt) && OPFPORTP(sockpt), sockpt, ARG1, s_getsockname); SYSCALL(sts = getsockname(fileno(STREAM(sockpt)), (struct sockaddr*)&sad, &sadlen);); if (sts || sizeof(sad) != sadlen) return BOOL_F; @@ -625,7 +628,6 @@ static iproc subr1s[] = { {s_inetstr, l_inetstr}, {s_network, l_network}, {s_lna, l_lna}, - {s_makaddr, l_makaddr}, {s_accept, l_accept}, {s_sknm_family, l_sknm_family}, |