1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

* net_db.c (scm_getserv): add missing SCM_ALLOW_INTS.

use htons in getservbyport argument.
This commit is contained in:
Gary Houston 1997-01-08 07:49:37 +00:00
parent 920235cc17
commit 65b376c7f2
3 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Wed Jan 8 06:54:54 1997 Gary Houston <ghouston@actrix.gen.nz>
* net_db.c (scm_getserv): add missing SCM_ALLOW_INTS.
use htons in getservbyport argument.
Tue Jan 7 18:11:24 1997 Jim Blandy <jimb@floss.cyclic.com>
* ports.h (SCM_PTOBNUM): Removed extraneous semicolon.

View file

@ -316,6 +316,7 @@ scm_getserv (name, proto)
entry = getservent ();
if (!entry)
scm_syserror (s_getserv);
SCM_ALLOW_INTS;
return scm_return_entry (entry);
}
SCM_ASSERT (SCM_NIMP (proto) && SCM_STRINGP (proto), proto, SCM_ARG2, s_getserv);
@ -328,10 +329,11 @@ scm_getserv (name, proto)
{
SCM_ASSERT (SCM_INUMP (name), name, SCM_ARG1, s_getserv);
SCM_DEFER_INTS;
entry = getservbyport (SCM_INUM (name), SCM_CHARS (proto));
entry = getservbyport (htons (SCM_INUM (name)), SCM_CHARS (proto));
}
if (!entry)
scm_syserror (s_getserv);
SCM_ALLOW_INTS;
return scm_return_entry (entry);
}

View file

@ -465,7 +465,7 @@ scm_addr_vector (address, proc)
ve[2] = scm_ulong2num ((unsigned long) ntohs (nad->sin_port));
}
else
scm_misc_error (proc, "Unrecognised internet address type: %s",
scm_misc_error (proc, "Unrecognised address family: %s",
scm_listify (SCM_MAKINUM (fam), SCM_UNSPECIFIED));
return result;