From 925ed47cfb2729953655f001df6cb9bd82360e19 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 28 Apr 1999 10:00:35 +0000 Subject: Update. * libio/iofopncook.c (_IO_cookie_seek): Correct return value. Patch by Peter Miller . 1999-04-27 Thorsten Kukuk * sunrpc/pmap_clnt.c: Add own get_myaddress function, which prefers loopback device. 1999-04-28 Ulrich Drepper --- ChangeLog | 10 +++++ libio/iofopncook.c | 7 +--- localedata/charmaps/UTF8 | 20 ++++----- localedata/repertoiremaps/mnemonic.ds | 2 +- sunrpc/pmap_clnt.c | 77 +++++++++++++++++++++++++++++++---- 5 files changed, 91 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 200c811dda..0ac46ab466 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +1999-04-28 Ulrich Drepper + + * libio/iofopncook.c (_IO_cookie_seek): Correct return value. + Patch by Peter Miller . + +1999-04-27 Thorsten Kukuk + + * sunrpc/pmap_clnt.c: Add own get_myaddress function, which + prefers loopback device. + 1999-04-28 Ulrich Drepper * posix/fnmatch.c (internal_fnmatch): Finish incomplete diff --git a/libio/iofopncook.c b/libio/iofopncook.c index 4f28ec20a8..7820fa325a 100644 --- a/libio/iofopncook.c +++ b/libio/iofopncook.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU IO Library. This library is free software; you can redistribute it and/or @@ -81,10 +81,7 @@ _IO_cookie_seek (fp, offset, dir) pos = _IO_pos_0; _IO_pos_adjust (pos, offset); - if (cfile->io_functions.seek (cfile->cookie, pos, dir)) - return _IO_pos_BAD; - - return pos; + return cfile->io_functions.seek (cfile->cookie, pos, dir); } static int diff --git a/localedata/charmaps/UTF8 b/localedata/charmaps/UTF8 index cb2a7a72fd..632e66bdaa 100644 --- a/localedata/charmaps/UTF8 +++ b/localedata/charmaps/UTF8 @@ -51,8 +51,8 @@ CHARMAP /x14 DEVICE CONTROL FOUR (DC4) /x15 NEGATIVE ACKNOWLEDGE (NAK) /x15 NEGATIVE ACKNOWLEDGE (NAK) - /x16 SYNCRONOUS IDLE (SYN) - /x16 SYNCRONOUS IDLE (SYN) + /x16 SYNCHRONOUS IDLE (SYN) + /x16 SYNCHRONOUS IDLE (SYN) /x17 END OF TRANSMISSION BLOCK (ETB) /x17 END OF TRANSMISSION BLOCK (ETB) /x18 CANCEL (CAN) @@ -524,8 +524,8 @@ CHARMAP /xc7/xad LATIN SMALL LETTER O WITH OGONEK AND MACRON /xc7/xae LATIN CAPITAL LETTER EZH WITH CARON /xc7/xaf LATIN SMALL LETTER EZH WITH CARON - /xc7/xb8 LATIN CAPITAL LETTER G WITH ACUTE - /xc7/xb9 LATIN SMALL LETTER G WITH ACUTE + /xc7/xb4 LATIN CAPITAL LETTER G WITH ACUTE + /xc7/xb5 LATIN SMALL LETTER G WITH ACUTE /xc7/xba LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE /xc7/xbb LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE /xc7/xbc LATIN CAPITAL LETTER AE WITH ACUTE @@ -560,7 +560,7 @@ CHARMAP <;S> /xca/xbb MODIFIER LETTER TURNED COMMA <1/>> /xcb/x86 MODIFIER LETTER CIRCUMFLEX ACCENT <'<> /xcb/x87 CARON (Mandarin Chinese third tone) -<1!> /xcb/x95 MODIFIER LETTER GRAVE ACCENT +<1!> /xcb/x8b MODIFIER LETTER GRAVE ACCENT <'(> /xcb/x98 BREVE <'.> /xcb/x99 DOT ABOVE (Mandarin Chinese light tone) <'0> /xcb/x9a RING ABOVE @@ -581,7 +581,7 @@ CHARMAP /xce/x8c GREEK CAPITAL LETTER OMICRON WITH TONOS /xce/x8e GREEK CAPITAL LETTER UPSILON WITH TONOS /xce/x8f GREEK CAPITAL LETTER OMEGA WITH TONOS - /xce/x90 GREEK SMALL LETTER IOTA WITH DIALYTICA AND TONOS + /xce/x90 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS /xce/x91 GREEK CAPITAL LETTER ALPHA /xce/x92 GREEK CAPITAL LETTER BETA /xce/x93 GREEK CAPITAL LETTER GAMMA @@ -1161,7 +1161,7 @@ CHARMAP <=s> /xe2/x82/x8c SUBSCRIPT EQUALS SIGN <(s> /xe2/x82/x8d SUBSCRIPT LEFT PARENTHESIS <)s> /xe2/x82/x8e SUBSCRIPT RIGHT PARENTHESIS - /xe2/x82/xa3 FRENCH FRANK SIGN + /xe2/x82/xa3 FRENCH FRANC SIGN
  • /xe2/x82/xa4 LIRA SIGN /xe2/x82/xa7 PESETA SIGN /xe2/x82/xa9 WON SIGN @@ -1546,7 +1546,7 @@ CHARMAP /xe2/x96/xa2 WHITE SQUARE WITH ROUNDED CORNERS /xe2/x96/xa3 WHITE SQUARE CONTAINING BLACK SMALL SQUARE /xe2/x96/xa4 SQUARE WITH HORIZONTAL FILL - /x00 SQUARE WITH VERTICAL FILL + /xe2/x96/xa5 SQUARE WITH VERTICAL FILL /xe2/x96/xa6 SQUARE WITH ORTHOGONAL CROSSHATCH FILL /xe2/x96/xa7 SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL /xe2/x96/xa8 SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL @@ -1608,7 +1608,7 @@ CHARMAP <,_> /xe3/x80/x81 IDEOGRAPHIC COMMA <._> /xe3/x80/x82 IDEOGRAPHIC FULL STOP <+"> /xe3/x80/x83 DITTO MARK - /xe3/x80/x84 JAPANESE INDUSTRIAL STANDARD SIGN + /xe3/x80/x84 JAPANESE INDUSTRIAL STANDARD SYMBOL <*_> /xe3/x80/x85 IDEOGRAPHIC ITERATION MARK <;_> /xe3/x80/x86 IDEOGRAPHIC CLOSING MARK <0_> /xe3/x80/x87 IDEOGRAPHIC NUMBER ZERO @@ -1829,7 +1829,7 @@ CHARMAP /xef/xac/x82 LATIN SMALL LIGATURE FL /xef/xac/x83 LATIN SMALL LIGATURE FFI /xef/xac/x84 LATIN SMALL LIGATURE FFL - /xef/xac/x85 LATIN SMALL LIGATURE FT + /xef/xac/x85 LATIN SMALL LIGATURE LONG S T /xef/xac/x86 LATIN SMALL LIGATURE ST <3+;> /xef/xb9/xbd ARABIC SHADDA MEDIAL FORM /xef/xba/x82 ARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORM diff --git a/localedata/repertoiremaps/mnemonic.ds b/localedata/repertoiremaps/mnemonic.ds index 3cc6fa36b7..e64bed9ab6 100644 --- a/localedata/repertoiremaps/mnemonic.ds +++ b/localedata/repertoiremaps/mnemonic.ds @@ -233,7 +233,7 @@ escape_char / SINGLE-SHIFT THREE (SS3) DEVICE CONTROL STRING (DCS) PRIVATE USE ONE (PU1) - PRIVATE USE ONE (PU2) + PRIVATE USE TWO (PU2) SET TRANSMIT STATE (STS) CANCEL CHARACTER (CCH) MESSAGE WAITING (MW) diff --git a/sunrpc/pmap_clnt.c b/sunrpc/pmap_clnt.c index 68bdfab01e..11e241dfcb 100644 --- a/sunrpc/pmap_clnt.c +++ b/sunrpc/pmap_clnt.c @@ -1,4 +1,3 @@ -/* @(#)pmap_clnt.c 2.2 88/08/01 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -27,21 +26,81 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ -#if !defined(lint) && defined(SCCSIDS) -static char sccsid[] = "@(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro"; -#endif - +/* + * Copyright (C) 1984, Sun Microsystems, Inc. + */ /* * pmap_clnt.c * Client interface to pmap rpc service. - * - * Copyright (C) 1984, Sun Microsystems, Inc. */ +#include +#include +#include +#include +#include +#include +#include #include #include #include +/* + * Same as get_myaddress, but we try to use the loopback + * interface. portmap caches interfaces, and on DHCP clients, + * it could be that only loopback is started at this time. + */ +static void +__get_myaddress (struct sockaddr_in *addr) +{ + int s; + char buf[BUFSIZ]; + struct ifconf ifc; + struct ifreq ifreq, *ifr; + int len, loopback = 1; + + if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0) + { + perror ("__get_myaddress: socket"); + exit (1); + } + ifc.ifc_len = sizeof (buf); + ifc.ifc_buf = buf; + if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) + { + perror (_("__get_myaddress: ioctl (get interface configuration)")); + exit (1); + } + + again: + ifr = ifc.ifc_req; + for (len = ifc.ifc_len; len; len -= sizeof ifreq) + { + ifreq = *ifr; + if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) + { + perror ("__get_myaddress: ioctl"); + exit (1); + } + if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET) + && ((ifreq.ifr_flags & IFF_LOOPBACK) || (loopback == 0))) + { + *addr = *((struct sockaddr_in *) &ifr->ifr_addr); + addr->sin_port = htons (PMAPPORT); + __close (s); + return; + } + ifr++; + } + if (loopback == 1) + { + loopback = 0; + goto again; + } + __close (s); +} + + static const struct timeval timeout = {5, 0}; static const struct timeval tottimeout = {60, 0}; @@ -58,7 +117,7 @@ pmap_set (u_long program, u_long version, int protocol, u_short port) struct pmap parms; bool_t rslt; - get_myaddress (&myaddress); + __get_myaddress (&myaddress); client = clntudp_bufcreate (&myaddress, PMAPPROG, PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE); if (client == (CLIENT *) NULL) @@ -92,7 +151,7 @@ pmap_unset (u_long program, u_long version) struct pmap parms; bool_t rslt; - get_myaddress (&myaddress); + __get_myaddress (&myaddress); client = clntudp_bufcreate (&myaddress, PMAPPROG, PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE); if (client == (CLIENT *) NULL) -- cgit 1.4.1