1997-07-08 02:18  Ulrich Drepper  <drepper@cygnus.com>

	* io/lockf.c (lockf): Clear fl before using.
	Patch by sr@adb.fr.

	* libio/strops.c: Correctly handle _IO_write_end.

	* nss/libnss_files.map: Add __nss_netgroup_parseline.
	* nss/nss_files/files-netgroup.c (_nss_netgroup_parseline): Don't
	panic if setnetgrent wasn't called before, return error.
	Patch by Thorsten Kukuk <kukuk@uni-paderborn.de>.

	* time/mktime.c: Define localtime_r function as my_mktime_localtime_r
	if locally defined.
	* time/strftime.c: Define localtime_r function as my_ftime_localtime_r
	if locally defined.
	Define tm_diff function as ftime_tm_diff if locally defined.
	Reported by Richard Stallman <rms@gnu.ai.mit.edu>.
This commit is contained in:
Ulrich Drepper 1997-07-08 00:44:35 +00:00
parent 762a2918ee
commit 9c2322bc08
9 changed files with 121 additions and 66 deletions

View File

@ -1,3 +1,22 @@
1997-07-08 02:18 Ulrich Drepper <drepper@cygnus.com>
* io/lockf.c (lockf): Clear fl before using.
Patch by sr@adb.fr.
* libio/strops.c: Correctly handle _IO_write_end.
* nss/libnss_files.map: Add __nss_netgroup_parseline.
* nss/nss_files/files-netgroup.c (_nss_netgroup_parseline): Don't
panic if setnetgrent wasn't called before, return error.
Patch by Thorsten Kukuk <kukuk@uni-paderborn.de>.
* time/mktime.c: Define localtime_r function as my_mktime_localtime_r
if locally defined.
* time/strftime.c: Define localtime_r function as my_ftime_localtime_r
if locally defined.
Define tm_diff function as ftime_tm_diff if locally defined.
Reported by Richard Stallman <rms@gnu.ai.mit.edu>.
1997-07-06 23:36 Ulrich Drepper <drepper@cygnus.com> 1997-07-06 23:36 Ulrich Drepper <drepper@cygnus.com>
* isomac.c (get_null_defines): Put NULL at end of list. * isomac.c (get_null_defines): Put NULL at end of list.

8
config.guess vendored
View File

@ -520,6 +520,14 @@ EOF
i?86:DYNIX/ptx:4*:*) i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4 echo i386-sequent-sysv4
exit 0 ;; exit 0 ;;
i?86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}

View File

@ -20,6 +20,7 @@
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <string.h>
/* lockf is a simplified interface to fcntl's locking facilities. */ /* lockf is a simplified interface to fcntl's locking facilities. */
@ -28,6 +29,8 @@ lockf (int fd, int cmd, off_t len)
{ {
struct flock fl; struct flock fl;
memset ((char *) &fl, '\0', sizeof (fl));
switch (cmd) switch (cmd)
{ {
case F_TEST: case F_TEST:

View File

@ -88,7 +88,7 @@ DEFUN(_IO_str_init_static, (fp, ptr, size, pstart),
if (pstart) if (pstart)
{ {
fp->_IO_write_ptr = pstart; fp->_IO_write_ptr = pstart;
fp->_IO_write_end = ptr+size; fp->_IO_write_end = pstart;
fp->_IO_read_end = pstart; fp->_IO_read_end = pstart;
} }
else else
@ -158,7 +158,7 @@ DEFUN(_IO_str_overflow, (fp, c),
fp->_IO_write_ptr = new_buf + (fp->_IO_write_ptr - old_buf); fp->_IO_write_ptr = new_buf + (fp->_IO_write_ptr - old_buf);
fp->_IO_write_base = new_buf; fp->_IO_write_base = new_buf;
fp->_IO_write_end = fp->_IO_buf_end; fp->_IO_write_end = new_buf + (fp->_IO_write_end - old_buf);
} }
} }

View File

@ -1,5 +1,5 @@
%% TeX macros to handle Texinfo files. %% TeX macros to handle Texinfo files.
%% $Id: texinfo.tex,v 2.206 1997/07/06 21:41:02 drepper Exp $ %% $Id: texinfo.tex,v 2.207 1997/07/07 13:08:20 drepper Exp $
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, % Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
% 94, 95, 96, 97 Free Software Foundation, Inc. % 94, 95, 96, 97 Free Software Foundation, Inc.
@ -36,7 +36,7 @@
% This automatically updates the version number based on RCS. % This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
\deftexinfoversion$Revision: 2.206 $ \deftexinfoversion$Revision: 2.207 $
\message{Loading texinfo package [Version \texinfoversion]:} \message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number % If in a .fmt file, print the version number
@ -189,7 +189,7 @@
% Only leave this space if the footline is nonempty. % Only leave this space if the footline is nonempty.
% (We lessened \vsize for it in \oddfootingxxx.) % (We lessened \vsize for it in \oddfootingxxx.)
% The \baselineskip=24pt in plain's \makefootline has no effect. % The \baselineskip=24pt in plain's \makefootline has no effect.
\vskip\baselineskip \vskip 2\baselineskip
\unvbox\footlinebox \unvbox\footlinebox
\fi \fi
% %
@ -1140,13 +1140,26 @@ where each line of input produces a line of output.}
\font\indi=cmmi9 \font\indi=cmmi9
\font\indsy=cmsy9 \font\indsy=cmsy9
% Fonts for title page:
\setfont\titlerm\rmbshape{12}{\magstep3}
\setfont\titleit\itbshape{10}{\magstep4}
\setfont\titlesl\slbshape{10}{\magstep4}
\setfont\titlett\ttbshape{12}{\magstep3}
\setfont\titlettsl\ttslshape{10}{\magstep4}
\setfont\titlesf\sfbshape{17}{\magstep1}
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\let\authorrm = \secrm
% Chapter (and unnumbered) fonts (17.28pt). % Chapter (and unnumbered) fonts (17.28pt).
\setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chaprm\rmbshape{12}{\magstep2}
\setfont\chapit\itbshape{10}{\magstep3} \setfont\chapit\itbshape{10}{\magstep3}
\setfont\chapsl\slbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3}
\setfont\chaptt\ttbshape{12}{\magstep2} \setfont\chaptt\ttbshape{12}{\magstep2}
\setfont\chapttsl\ttslshape{10}{\magstep3} \setfont\chapttsl\ttslshape{10}{\magstep3}
\setfont\chapsf\sfbshape{12}{\magstep2} \setfont\chapsf\sfbshape{17}{1000}
\let\chapbf=\chaprm \let\chapbf=\chaprm
\setfont\chapsc\scbshape{10}{\magstep3} \setfont\chapsc\scbshape{10}{\magstep3}
\font\chapi=cmmi12 scaled \magstep2 \font\chapi=cmmi12 scaled \magstep2
@ -1183,19 +1196,15 @@ where each line of input produces a line of output.}
\setfont\ssecit\itbshape{10}{1315} \setfont\ssecit\itbshape{10}{1315}
\setfont\ssecsl\slbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315}
\setfont\ssectt\ttbshape{12}{\magstephalf} \setfont\ssectt\ttbshape{12}{\magstephalf}
\setfont\ssecttsl\ttslshape{10}{\magstep1} \setfont\ssecttsl\ttslshape{10}{1315}
\setfont\ssecsf\sfbshape{12}{\magstephalf} \setfont\ssecsf\sfbshape{12}{\magstephalf}
\let\ssecbf\ssecrm \let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{\magstep1} \setfont\ssecsc\scbshape{10}{\magstep1}
\font\sseci=cmmi12 scaled \magstephalf \font\sseci=cmmi12 scaled \magstephalf
\font\ssecsy=cmsy10 scaled \magstep1 \font\ssecsy=cmsy10 scaled 1315
% The smallcaps and symbol fonts should actually be scaled \magstep1.5, % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
% but that is not a standard magnification. % but that is not a standard magnification.
% Fonts for title page:
\setfont\titlerm\rmbshape{12}{\magstep3}
\let\authorrm = \secrm
% In order for the font changes to affect most math symbols and letters, % In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families. Since % we have to define the \textfont of the standard families. Since
% texinfo doesn't allow for producing subscripts and superscripts, we % texinfo doesn't allow for producing subscripts and superscripts, we
@ -1220,6 +1229,12 @@ where each line of input produces a line of output.}
\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
\let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
\resetmathfonts} \resetmathfonts}
\def\titlefonts{%
\let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
\let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
\let\tenttsl=\titlettsl
\resetmathfonts \setleading{25pt}}
\def\chapfonts{% \def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
@ -1357,14 +1372,27 @@ where each line of input produces a line of output.}
% @kbd is like @code, except that if the argument is just one @key command, % @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect. % then @kbd has no effect.
% Font to use for @kbd, ordinarily. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
\let\kbdfont\t % `example' (@kbd uses ttsl only inside of @example and friends),
% Font to use for @kbd, when inside @example. % or `code' (@kbd uses normal tty font always).
\let\kbdexamplefont\t \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
\def\kbdinputstylexxx#1{%
\def\arg{#1}%
\ifx\arg\worddistinct
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
\else\ifx\arg\wordexample
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
\else\ifx\arg\wordcode
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
\fi\fi\fi
}
\def\worddistinct{distinct}
\def\wordexample{example}
\def\wordcode{code}
% If you use @setkbdinputdistinct, then @kbd produces slanted tty font. % Default is kbdinputdistinct. (Too much of a hassle to call the macro,
\def\setkbdinputdistinct{\let\kbdfont\ttsl % the catcodes are wrong for parsearg to work.)
\let\kbdexamplefont\ttsl} \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
% If you use @setkbdinputexample, then @kbd produces slanted tty font % If you use @setkbdinputexample, then @kbd produces slanted tty font
% only inside of @example and friends. % only inside of @example and friends.
@ -1430,8 +1458,6 @@ where each line of input produces a line of output.}
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
% First the title page. Must do @settitle before @titlepage. % First the title page. Must do @settitle before @titlepage.
\def\titlefont#1{{\titlerm #1}}
\newif\ifseenauthor \newif\ifseenauthor
\newif\iffinishedtitlepage \newif\iffinishedtitlepage
@ -1453,7 +1479,7 @@ where each line of input produces a line of output.}
% %
% Now you can print the title using @title. % Now you can print the title using @title.
\def\title{\parsearg\titlezzz}% \def\title{\parsearg\titlezzz}%
\def\titlezzz##1{\leftline{\titlefont{##1}} \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
% print a rule at the page bottom also. % print a rule at the page bottom also.
\finishedtitlepagefalse \finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt}% \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
@ -4368,29 +4394,27 @@ width0pt\relax} \fi
% Read the last existing aux file, if any. No error if none exists. % Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup \def\readauxfile{\begingroup
\catcode`\^^@=\other \catcode`\^^@=\other
\catcode`\=\other \catcode`\^=\other
\catcode`\=\other \catcode`\^=\other
\catcode`\^^C=\other \catcode`\^^C=\other
\catcode`\^^D=\other \catcode`\^^D=\other
\catcode`\^^E=\other \catcode`\^^E=\other
\catcode`\^^F=\other \catcode`\^^F=\other
\catcode`\^^G=\other \catcode`\^^G=\other
\catcode`\^^H=\other \catcode`\^^H=\other
\catcode`\ =\other \catcode`\^ =\other
\catcode`\^^L=\other \catcode`\^^L=\other
\catcode`\=\other \catcode`\^^N=\other
\catcode`\=\other \catcode`\^^P=\other
\catcode`\=\other \catcode`\^^Q=\other
\catcode`\=\other \catcode`\^^R=\other
\catcode`\=\other \catcode`\^^S=\other
\catcode`\=\other \catcode`\^^T=\other
\catcode`\=\other \catcode`\^^U=\other
\catcode`\=\other \catcode`\^^V=\other
\catcode`\=\other \catcode`\^^W=\other
\catcode`\=\other \catcode`\^^X=\other
\catcode`\=\other \catcode`\^^Z=\other
\catcode`\=\other
\catcode26=\other
\catcode`\^^[=\other \catcode`\^^[=\other
\catcode`\^^\=\other \catcode`\^^\=\other
\catcode`\^^]=\other \catcode`\^^]=\other
@ -4468,7 +4492,7 @@ width0pt\relax} \fi
% space to prevent strange expansion errors.) % space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 } \def\supereject{\par\penalty -20000\footnoteno =0 }
% @footnotestyle is meaningful for info output only.. % @footnotestyle is meaningful for info output only.
\let\footnotestyle=\comment \let\footnotestyle=\comment
\let\ptexfootnote=\footnote \let\ptexfootnote=\footnote

View File

@ -22,6 +22,7 @@ GLIBC_2.0 {
_nss_files_setgrent; _nss_files_sethostent; _nss_files_setnetent; _nss_files_setgrent; _nss_files_sethostent; _nss_files_setnetent;
_nss_files_setnetgrent; _nss_files_setprotoent; _nss_files_setpwent; _nss_files_setnetgrent; _nss_files_setprotoent; _nss_files_setpwent;
_nss_files_setrpcent; _nss_files_setservent; _nss_files_setspent; _nss_files_setrpcent; _nss_files_setservent; _nss_files_setspent;
__nss_netgroup_parseline;
local: local:
*; *;

View File

@ -1,5 +1,5 @@
/* Netgroup file parser in nss_files modules. /* Netgroup file parser in nss_files modules.
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@ -170,8 +170,7 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
/* Some sanity checks. */ /* Some sanity checks. */
if (cp == NULL) if (cp == NULL)
/* User bug. setnetgrent() wasn't called before. */ return NSS_STATUS_NOTFOUND;
abort ();
/* First skip leading spaces. */ /* First skip leading spaces. */
while (isspace (*cp)) while (isspace (*cp))

View File

@ -22,7 +22,7 @@
/* #define DEBUG 1 */ /* #define DEBUG 1 */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> # include <config.h>
#endif #endif
#ifdef _LIBC #ifdef _LIBC
@ -35,52 +35,52 @@
If the host has a `zic' command with a `-L leapsecondfilename' option, If the host has a `zic' command with a `-L leapsecondfilename' option,
then it supports leap seconds; otherwise it probably doesn't. */ then it supports leap seconds; otherwise it probably doesn't. */
#ifndef LEAP_SECONDS_POSSIBLE #ifndef LEAP_SECONDS_POSSIBLE
#define LEAP_SECONDS_POSSIBLE 1 # define LEAP_SECONDS_POSSIBLE 1
#endif #endif
#include <sys/types.h> /* Some systems define `time_t' here. */ #include <sys/types.h> /* Some systems define `time_t' here. */
#include <time.h> #include <time.h>
#if HAVE_LIMITS_H #if HAVE_LIMITS_H
#include <limits.h> # include <limits.h>
#endif #endif
#if DEBUG #if DEBUG
#include <stdio.h> # include <stdio.h>
#if STDC_HEADERS # if STDC_HEADERS
#include <stdlib.h> # include <stdlib.h>
#endif # endif
/* Make it work even if the system's libc has its own mktime routine. */ /* Make it work even if the system's libc has its own mktime routine. */
#define mktime my_mktime # define mktime my_mktime
#endif /* DEBUG */ #endif /* DEBUG */
#ifndef __P #ifndef __P
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) # if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
#define __P(args) args # define __P(args) args
#else # else
#define __P(args) () # define __P(args) ()
#endif /* GCC. */ # endif /* GCC. */
#endif /* Not __P. */ #endif /* Not __P. */
#ifndef CHAR_BIT #ifndef CHAR_BIT
#define CHAR_BIT 8 # define CHAR_BIT 8
#endif #endif
#ifndef INT_MIN #ifndef INT_MIN
#define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1)) # define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1))
#endif #endif
#ifndef INT_MAX #ifndef INT_MAX
#define INT_MAX (~0 - INT_MIN) # define INT_MAX (~0 - INT_MIN)
#endif #endif
#ifndef TIME_T_MIN #ifndef TIME_T_MIN
/* The outer cast to time_t works around a bug in Cray C 5.0.3.0. */ /* The outer cast to time_t works around a bug in Cray C 5.0.3.0. */
#define TIME_T_MIN ((time_t) \ # define TIME_T_MIN ((time_t) \
(0 < (time_t) -1 ? (time_t) 0 \ (0 < (time_t) -1 ? (time_t) 0 \
: ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1))) : ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1)))
#endif #endif
#ifndef TIME_T_MAX #ifndef TIME_T_MAX
#define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN) # define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN)
#endif #endif
#define TM_YEAR_BASE 1900 #define TM_YEAR_BASE 1900
@ -89,7 +89,7 @@
#ifndef __isleap #ifndef __isleap
/* Nonzero if YEAR is a leap year (every 4 years, /* Nonzero if YEAR is a leap year (every 4 years,
except every 100th isn't, and every 400th is). */ except every 100th isn't, and every 400th is). */
#define __isleap(year) \ # define __isleap(year) \
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
#endif #endif
@ -109,11 +109,11 @@ time_t __mktime_internal __P ((struct tm *,
#ifdef _LIBC #ifdef _LIBC
#define localtime_r __localtime_r # define localtime_r __localtime_r
#else #else
#if ! HAVE_LOCALTIME_R && ! defined (localtime_r) # if ! HAVE_LOCALTIME_R && ! defined localtime_r
/* Approximate localtime_r as best we can in its absence. */ /* Approximate localtime_r as best we can in its absence. */
#define localtime_r my_localtime_r # define localtime_r my_mktime_localtime_r
static struct tm *localtime_r __P ((const time_t *, struct tm *)); static struct tm *localtime_r __P ((const time_t *, struct tm *));
static struct tm * static struct tm *
localtime_r (t, tp) localtime_r (t, tp)
@ -126,7 +126,7 @@ localtime_r (t, tp)
*tp = *l; *tp = *l;
return tp; return tp;
} }
#endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */ # endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */
#endif /* ! _LIBC */ #endif /* ! _LIBC */

View File

@ -155,7 +155,7 @@ gmtime_r (t, tp)
# endif /* ! HAVE_TM_GMTOFF */ # endif /* ! HAVE_TM_GMTOFF */
/* Approximate localtime_r as best we can in its absence. */ /* Approximate localtime_r as best we can in its absence. */
# define localtime_r my_localtime_r # define localtime_r my_ftime_localtime_r
static struct tm *localtime_r __P ((const time_t *, struct tm *)); static struct tm *localtime_r __P ((const time_t *, struct tm *));
static struct tm * static struct tm *
localtime_r (t, tp) localtime_r (t, tp)
@ -287,6 +287,7 @@ memcpy_uppcase (dest, src, len)
#if ! HAVE_TM_GMTOFF #if ! HAVE_TM_GMTOFF
/* Yield the difference between *A and *B, /* Yield the difference between *A and *B,
measured in seconds, ignoring leap seconds. */ measured in seconds, ignoring leap seconds. */
# define tm_diff ftime_tm_diff
static int tm_diff __P ((const struct tm *, const struct tm *)); static int tm_diff __P ((const struct tm *, const struct tm *));
static int static int
tm_diff (a, b) tm_diff (a, b)