From 9d647dfc304fce778fe90578a41b7af72b2f9902 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 27 Jan 2003 16:20:14 +0000 Subject: 2003-01-27 Till Straumann * libc/getproto.c, libc/getprotoname.c: modification to call getprotoent_static() if fopen() on /etc/protocols fails. --- cpukit/libnetworking/ChangeLog | 5 +++++ cpukit/libnetworking/libc/getproto.c | 5 +++++ cpukit/libnetworking/libc/getprotoname.c | 5 +++++ 3 files changed, 15 insertions(+) (limited to 'cpukit/libnetworking') diff --git a/cpukit/libnetworking/ChangeLog b/cpukit/libnetworking/ChangeLog index 63ca432386..ddfe2aa80d 100644 --- a/cpukit/libnetworking/ChangeLog +++ b/cpukit/libnetworking/ChangeLog @@ -1,3 +1,8 @@ +2003-01-27 Till Straumann + + * libc/getproto.c, libc/getprotoname.c: modification to call + getprotoent_static() if fopen() on /etc/protocols fails. + 2003-01-15 Ralf Corsepius * netinet/tcp_subr.c: Add args to INP_INFO_RLOCK, INP_INFO_RUNLOCK, diff --git a/cpukit/libnetworking/libc/getproto.c b/cpukit/libnetworking/libc/getproto.c index c2a653f4b4..67f59b4e86 100644 --- a/cpukit/libnetworking/libc/getproto.c +++ b/cpukit/libnetworking/libc/getproto.c @@ -41,6 +41,8 @@ static char sccsid[] = "@(#)getproto.c 8.1 (Berkeley) 6/4/93"; extern int _proto_stayopen; +extern struct protoent * getprotobynumber_static(int); + struct protoent * getprotobynumber(proto) register int proto; @@ -53,5 +55,8 @@ getprotobynumber(proto) break; if (!_proto_stayopen) endprotoent(); + + if ( !p ) + p = getprotobynumber_static(proto); return (p); } diff --git a/cpukit/libnetworking/libc/getprotoname.c b/cpukit/libnetworking/libc/getprotoname.c index 46880eb005..e21e4c4f2a 100644 --- a/cpukit/libnetworking/libc/getprotoname.c +++ b/cpukit/libnetworking/libc/getprotoname.c @@ -42,6 +42,8 @@ static char sccsid[] = "@(#)getprotoname.c 8.1 (Berkeley) 6/4/93"; extern int _proto_stayopen; +extern struct protoent *getprotobyname_static(const char *); + struct protoent * getprotobyname(name) register const char *name; @@ -60,5 +62,8 @@ getprotobyname(name) found: if (!_proto_stayopen) endprotoent(); + + if ( !p ) + p = getprotobyname_static(name); return (p); } -- cgit v1.2.3