]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* sysdeps/unix/sysv/linux/m68k/getsysstats.c (GET_NPROCS_PARSER):
authorJoseph Myers <joseph@codesourcery.com>
Tue, 17 Mar 2009 17:41:36 +0000 (17:41 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 17 Mar 2009 17:41:36 +0000 (17:41 +0000)
Change parameters and use next_line.

ChangeLog.m68k
sysdeps/unix/sysv/linux/m68k/getsysstats.c

index 32d01cf7bbfaa66d152f50f2987e9e37c97467a1..b6305783ad564c238c7746b2c641214a9212bd67 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-17  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/m68k/getsysstats.c (GET_NPROCS_PARSER):
+       Change parameters and use next_line.
+
 2009-03-15  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/m68k/bits/link.h: Uglify function parameter names.
index 23207e9bcb2bcaf24ded728dbca8fa0e57001f7c..51137204e381b30ddcb2ab038bee8344c5bbd096 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine various system internal values, Linux/m68k version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Schwab <schwab@suse.de>
 
@@ -20,7 +20,7 @@
 
 
 /* We need to define a special parser for /proc/cpuinfo.  */
-#define GET_NPROCS_PARSER(FP, BUFFER, RESULT)                            \
+#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT)        \
   do                                                                     \
     {                                                                    \
       (RESULT) = 0;                                                      \
@@ -28,8 +28,9 @@
         "CPU:".  We don't have to fear extremely long lines since        \
         the kernel will not generate them.  8192 bytes are really        \
         enough.  */                                                      \
-      while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL)       \
-       if (strncmp (BUFFER, "CPU:", 4) == 0)                             \
+      char *l;                                                           \
+      while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL)  \
+       if (strncmp (l, "CPU:", 4) == 0)                                  \
          ++(RESULT);                                                     \
     }                                                                    \
   while (0)