]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 5 Jul 1998 12:05:16 +0000 (12:05 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 5 Jul 1998 12:05:16 +0000 (12:05 +0000)
1998-07-05 11:49  Ulrich Drepper  <drepper@cygnus.com>

* iconv/gconv_conf.c (read_conf_file): Use feof_unlocked on private
stream.
* inet/ruserpass.c (token): Likewise.
* nss/nsswitch.c (nss_parse_file): Likewise.
* intl/localealias.c: Likewise.  Also for ferror.
* time/getdate.c (__getdate_r): Likewise.

* libio/Makefile (routines): Add iofgets_u.
* libio/iofgets_u.c: New file.
* libio/Versions: Add fgets_unlocked.
* libio/stdio.h: Add prototype for fgets_unlocked.

* misc/getttyent.c (getttyent): Use fgets_unlocked instead of fgets.
* misc/getusershell.c (initshells): Likewise.
* misc/mntent_r.c (__getmntent_r): Explicitly lock stream.  Use
fgets_unlocked.
* nss/nss_files/files-XXX.c (internal_getent): Likewise.
* resolv/res_init.c (res_init): Likewise.
* sysdeps/unix/sysv/linux/getsysstats.c: Likewise.

ChangeLog
misc/getttyent.c
misc/getusershell.c
misc/mntent_r.c
nss/nss_files/files-XXX.c
nss/nsswitch.c
resolv/res_init.c
sysdeps/unix/sysv/linux/getsysstats.c
time/getdate.c

index a6f27976879be839933e062c730cddf6f2227fbd..c19873f62af8eb0ce0c39032372d72d567c4d6a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+1998-07-05 11:49  Ulrich Drepper  <drepper@cygnus.com>
+
+       * iconv/gconv_conf.c (read_conf_file): Use feof_unlocked on private
+       stream.
+       * inet/ruserpass.c (token): Likewise.
+       * nss/nsswitch.c (nss_parse_file): Likewise.
+       * intl/localealias.c: Likewise.  Also for ferror.
+       * time/getdate.c (__getdate_r): Likewise.
+
+       * libio/Makefile (routines): Add iofgets_u.
+       * libio/iofgets_u.c: New file.
+       * libio/Versions: Add fgets_unlocked.
+       * libio/stdio.h: Add prototype for fgets_unlocked.
+
+       * misc/getttyent.c (getttyent): Use fgets_unlocked instead of fgets.
+       * misc/getusershell.c (initshells): Likewise.
+       * misc/mntent_r.c (__getmntent_r): Explicitly lock stream.  Use
+       fgets_unlocked.
+       * nss/nss_files/files-XXX.c (internal_getent): Likewise.
+       * resolv/res_init.c (res_init): Likewise.
+       * sysdeps/unix/sysv/linux/getsysstats.c: Likewise.
+
 1998-05-23  Philip Blundell  <Philip.Blundell@pobox.com>
 
        * sysdeps/unix/sysv/linux/arm/syscalls.list: Add `syscall'.
index f474cdcacfa9a1d07a2b3282df42f7717539688a..07018f70518270c7bc02e92b74d31d868635c624 100644 (file)
@@ -73,7 +73,7 @@ getttyent()
                return (NULL);
        flockfile (tf);
        for (;;) {
-               if (!fgets(p = line, sizeof(line), tf))
+               if (!fgets_unlocked(p = line, sizeof(line), tf))
                        return (NULL);
                /* skip lines that are too big */
                if (!index(p, '\n')) {
index 6b210b68ffd98ff8a342c4807f7bdd6ce775c35d..d822f554ea20957f6b2936f29d258412a18c079a 100644 (file)
@@ -96,6 +96,7 @@ initshells()
        register char **sp, *cp;
        register FILE *fp;
        struct stat statb;
+       int flen;
 
        if (shells != NULL)
                free(shells);
@@ -122,7 +123,8 @@ initshells()
        }
        sp = shells;
        cp = strings;
-       while (fgets(cp, statb.st_size - (cp - strings), fp) != NULL) {
+       flen = statb.st_size;
+       while (fgets_unlocked(cp, flen - (cp - strings), fp) != NULL) {
                while (*cp != '#' && *cp != '/' && *cp != '\0')
                        cp++;
                if (*cp == '#' || *cp == '\0')
index 4dc0358f03928c15f274c99c3f94b89421cb2e66..9567a6f0771e82b8eeab23d11136890f4835d3f7 100644 (file)
@@ -1,5 +1,5 @@
 /* Utilities for reading/writing fstab, mtab, etc.
-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -51,11 +51,12 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz)
 {
   char *head;
 
+  flockfile (stream);
   do
     {
       char *end_ptr;
 
-      if (fgets (buffer, bufsiz, stream) == NULL)
+      if (fgets_unlocked (buffer, bufsiz, stream) == NULL)
        return NULL;
 
       end_ptr = strchr (buffer, '\n');
@@ -65,7 +66,7 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz)
        {
          /* Not the whole line was read.  Do it now but forget it.  */
          char tmp[1024];
-         while (fgets (tmp, sizeof tmp, stream) != NULL)
+         while (fgets_unlocked (tmp, sizeof tmp, stream) != NULL)
            if (strchr (tmp, '\n') != NULL)
              break;
        }
@@ -92,6 +93,7 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz)
       mp->mnt_passno = 0;
     case 2:
     }
+  funlockfile (stream);
 
   return mp;
 }
index d6a7911b66306c8221e7afa5e9ad888fa9f91663..9432b14b34eaa3238fd6c4f747497640925c4038 100644 (file)
@@ -181,7 +181,7 @@ internal_getent (struct STRUCTURE *result,
       /* Terminate the line so that we can test for overflow.  */
       data->linebuffer[linebuflen - 1] = '\xff';
 
-      p = fgets (data->linebuffer, linebuflen, stream);
+      p = fgets_unlocked (data->linebuffer, linebuflen, stream);
       if (p == NULL)
        {
          /* End of file or read error.  */
index f010d2755c6349ff4f9fd1e06196679761accd20..644343a030ab2bae2935846ad6018ef2d18a8f1b 100644 (file)
@@ -536,7 +536,7 @@ nss_parse_file (const char *fname)
          last = this;
        }
     }
-  while (!feof (fp));
+  while (!feof_unlocked (fp));
 
   /* Free the buffer.  */
   free (line);
index a2de01f1a226f44de41fc5261efcedd8b5a02017..b22611b087c22b0f5bae00916205bdfc83cf564c 100644 (file)
@@ -259,7 +259,7 @@ res_init()
 #endif
        if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) {
            /* read the config file */
-           while (fgets(buf, sizeof(buf), fp) != NULL) {
+           while (fgets_unlocked(buf, sizeof(buf), fp) != NULL) {
                /* skip comments */
                if (*buf == ';' || *buf == '#')
                        continue;
index 26f8179afea1d983327526f3fba6759a046fa689..58f55ac99c51f7d6a7a987be100a7428b280effa 100644 (file)
@@ -94,7 +94,7 @@ __get_nprocs ()
             string "processor".  We don't have to fear extremely long
             lines since the kernel will not generate them.  8192
             bytes are really enough.  */
-         while (fgets (buffer, sizeof buffer, fp) != NULL)
+         while (fgets_unlocked (buffer, sizeof buffer, fp) != NULL)
            if (strncmp (buffer, "processor", 9) == 0)
              ++result;
 
@@ -141,7 +141,7 @@ phys_pages_info (const char *format)
             string "processor".  We don't have to fear extremely long
             lines since the kernel will not generate them.  8192
             bytes are really enough.  */
-         while (fgets (buffer, sizeof buffer, fp) != NULL)
+         while (fgets_unlocked (buffer, sizeof buffer, fp) != NULL)
            if (sscanf (buffer, format, &result) == 1)
              {
                result /= (__getpagesize () / 1024);
index 524abde0386c9756540f8b9eaf0adeb2818eb3a5..eb7b0c7f8762e9268bfc77190369d599f3b49835 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert a string representation of time to a time value.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
 
@@ -145,13 +145,13 @@ __getdate_r (const char *string, struct tm *tp)
       if (result && *result == '\0')
        break;
     }
-  while (!feof (fp));
+  while (!feof_unlocked (fp));
 
   /* Free the buffer.  */
   free (line);
 
   /* Check for errors. */
-  if (ferror (fp))
+  if (ferror_unlocked (fp))
     {
       fclose (fp);
       return 5;
This page took 0.066367 seconds and 5 git commands to generate.