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

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

index ee9c8350240eff14777c398d93bb6a3a34b057fb..db313159074db5af982c3d6356af760c3d40b728 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-17  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/mips/getsysstats.c (GET_NPROCS_PARSER):
+       Change parameters and use next_line.
+
 2009-03-17  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Include errno.h.
index 9b521ac76a642e6435036b8ab3dc18f7a9a1d88e..805303326c7e477ee3f6e239497d3a738ecea3e9 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine various system internal values, Linux/MIPS version.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2009 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
@@ -19,7 +19,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;                                                      \
@@ -27,8 +27,9 @@
         "cpu model".  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 model", 9) == 0)                        \
+      char *l;                                                           \
+      while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL)  \
+       if (strncmp (l, "cpu model", 9) == 0)                             \
          ++(RESULT);                                                     \
     }                                                                    \
   while (0)