[BusyBox-cvs] busybox/libbb xconnect.c,1.11,1.12
Glenn McGrath
bug1 at busybox.net
Sat Jan 17 05:03:33 UTC 2004
- Previous message: [BusyBox-cvs] busybox/include libbb.h,1.124,1.125
- Next message: [BusyBox-cvs] busybox/networking ftpgetput.c, 1.13, 1.14 inetd.c, 1.11, 1.12 nc.c, 1.21, 1.22 telnet.c, 1.40, 1.41 tftp.c, 1.20, 1.21 wget.c, 1.64, 1.65
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/cvs/busybox/libbb
In directory nail:/tmp/cvs-serv356/libbb
Modified Files:
xconnect.c
Log Message:
Modify bb_lookup_port to allow the protocol to be specified, allowing
/etc/services support for inetd, netcat and tftp.
Index: xconnect.c
===================================================================
RCS file: /var/cvs/busybox/libbb/xconnect.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- xconnect.c 23 Dec 2003 20:37:54 -0000 1.11
+++ xconnect.c 17 Jan 2004 05:03:31 -0000 1.12
@@ -23,7 +23,7 @@
* If "port" is a name it is looked up in /etc/services, if it isnt found return
* default_port
*/
-unsigned short bb_lookup_port(const char *port, unsigned short default_port)
+unsigned short bb_lookup_port(const char *port, const char *protocol, unsigned short default_port)
{
unsigned short port_nr = htons(default_port);
if (port) {
@@ -37,7 +37,7 @@
errno = 0;
port_long = strtol(port, &endptr, 10);
if (errno != 0 || *endptr!='\0' || endptr==port || port_long < 0 || port_long > 65535) {
- struct servent *tserv = getservbyname(port, "tcp");
+ struct servent *tserv = getservbyname(port, protocol);
if (tserv) {
port_nr = tserv->s_port;
}
- Previous message: [BusyBox-cvs] busybox/include libbb.h,1.124,1.125
- Next message: [BusyBox-cvs] busybox/networking ftpgetput.c, 1.13, 1.14 inetd.c, 1.11, 1.12 nc.c, 1.21, 1.22 telnet.c, 1.40, 1.41 tftp.c, 1.20, 1.21 wget.c, 1.64, 1.65
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the busybox-cvs
mailing list