aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-03-17 15:52:15 +0000
committerJoseph Myers <joseph@codesourcery.com>2009-03-17 15:52:15 +0000
commit4c8c18106e3f50e86804469fdbb4eb2f6f9fdac7 (patch)
treec448f2acd3a0425021921ec2bf61459ca8c513e6
parent340f79762887912b27b6cd56de5c6fa1f2fbfcef (diff)
downloadglibc-4c8c18106e3f50e86804469fdbb4eb2f6f9fdac7.tar.xz
glibc-4c8c18106e3f50e86804469fdbb4eb2f6f9fdac7.zip
* sysdeps/unix/sysv/linux/mips/getsysstats.c (GET_NPROCS_PARSER):
Change parameters and use next_line.
-rw-r--r--ChangeLog.mips5
-rw-r--r--sysdeps/unix/sysv/linux/mips/getsysstats.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog.mips b/ChangeLog.mips
index ee9c835024..db31315907 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,5 +1,10 @@
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.
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
diff --git a/sysdeps/unix/sysv/linux/mips/getsysstats.c b/sysdeps/unix/sysv/linux/mips/getsysstats.c
index 9b521ac76a..805303326c 100644
--- a/sysdeps/unix/sysv/linux/mips/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/mips/getsysstats.c
@@ -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)