summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-06-09 18:15:57 -0700
committerDavid 'Digit' Turner <digit@google.com>2010-06-09 18:15:57 -0700
commit038fbae518e904c7aba64779714a22dbeeb90887 (patch)
tree713fecf819f653c56c3f8b2bae0e8e86a7afa2e6
parent9205fdf8c689a9cb27cfb33aeb58789c7da75788 (diff)
downloadbionic-038fbae518e904c7aba64779714a22dbeeb90887.zip
bionic-038fbae518e904c7aba64779714a22dbeeb90887.tar.gz
bionic-038fbae518e904c7aba64779714a22dbeeb90887.tar.bz2
sysconf(): Fix line parser for /proc files.
Change-Id: I2678010ee95933de19c8a8e3b2fe65ceb9b86400
-rw-r--r--libc/docs/CHANGES.TXT3
-rw-r--r--libc/unistd/sysconf.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/libc/docs/CHANGES.TXT b/libc/docs/CHANGES.TXT
index c8bdb6f..8bfa61e 100644
--- a/libc/docs/CHANGES.TXT
+++ b/libc/docs/CHANGES.TXT
@@ -13,6 +13,9 @@ Differences between current and Android 2.2:
- <sys/sysinfo.h>: Added missing sysinfo() system call implementation
(the function was already declared in the header though).
+- sysconf() didn't work for some arguments due to a small bug in the
+ /proc line parser.
+
-------------------------------------------------------------------------------
Differences between Android 2.2. and Android 2.1:
diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c
index d3089a4..dedc5bc 100644
--- a/libc/unistd/sysconf.c
+++ b/libc/unistd/sysconf.c
@@ -317,7 +317,7 @@ line_parser_addc( LineParser* p, int c )
static int
line_parser_getc( LineParser* p )
{
- if (p->in_len >= p->in_pos) {
+ if (p->in_pos >= p->in_len) {
int ret;
p->in_len = p->in_pos = 0;