Hi,
I found `open-network-stream' doesn't work with an integer for
the fourth argument. It can be reproduced with XEmacs 21.4.17
built in at least the Fedora Core 4 system (but there's no
problem in some other platforms, e.g., Solaris 2.6). For
instance, the following form causes an error:
(delete-process
(open-network-stream "POP" (current-buffer) "popserver" 110))
Debugger entered--Lisp error: (error "popserver/'D & Servname not supported
for ai_socktype")
open-network-stream-internal("POP" #<buffer "*scratch*">
"popserver" 110 nil)
open-network-stream("POP" #<buffer "*scratch*">
"popserver" 110)
We can use this function with only a string which specifies a
port number as follows:
(delete-process
(open-network-stream "POP" (current-buffer) "popserver"
"110"))
Naoto Morishima investigated it in detail and made the patch,
and I confirmed it works in the Fedora Core 4 system.
2005-11-24 Naoto Morishima <naoto(a)dl.naist.jp>
* process-unix.c (unix_open_network_stream): Make it
work with an integer for the fourth argument.
--- process-unix.c~ 2005-02-13 21:58:19 +0000
+++ process-unix.c 2005-11-24 10:53:07 +0000
@@ -1684,13 +1684,13 @@
volatile int xerrno = 0;
volatile int failed_connect = 0;
char *ext_host;
+ char portbuf[128];
/*
* Caution: service can either be a string or int.
* Convert to a C string for later use by getaddrinfo.
*/
if (INTP (service))
{
- char portbuf[128];
snprintf (portbuf, sizeof (portbuf), "%ld", (long) XINT (service));
portstring = portbuf;
port = htons ((unsigned short) XINT (service));