From 038fbae518e904c7aba64779714a22dbeeb90887 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Wed, 9 Jun 2010 18:15:57 -0700 Subject: [PATCH] sysconf(): Fix line parser for /proc files. Change-Id: I2678010ee95933de19c8a8e3b2fe65ceb9b86400 --- libc/docs/CHANGES.TXT | 3 +++ libc/unistd/sysconf.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libc/docs/CHANGES.TXT b/libc/docs/CHANGES.TXT index c8bdb6f5f..8bfa61e7f 100644 --- a/libc/docs/CHANGES.TXT +++ b/libc/docs/CHANGES.TXT @@ -13,6 +13,9 @@ Differences between current and Android 2.2: - : 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 d3089a4a4..dedc5bc17 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; -- 2.11.0