Message ID | 20180711164925.65342-1-astrachan@google.com |
---|---|
State | Accepted |
Delegated to: | Petr Vorel |
Headers | show |
Series | cpuset_lib: Replace index() with strchr() | expand |
Hi Alistair, > The index() function was removed in POSIX.2008. It is not implemented by > Android's bionic C library for 64-bit platforms. > Use the more portable strchr() function from C89. > Signed-off-by: Alistair Strachan <astrachan@google.com> Thanks for your patch, pushed! Kind regards, Petr
diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c b/testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c index c2a60b683..575a61bcd 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c +++ b/testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c @@ -59,7 +59,7 @@ static int get_cpu_baseinfo(void) /* get cpuinfo */ while (fgets(buf, sizeof(buf), fp) != NULL) { istr = strtok_r(buf, "\t", &saveptr); - valstr = index(saveptr, ':'); + valstr = strchr(saveptr, ':'); if (valstr == NULL) continue; valstr++;
The index() function was removed in POSIX.2008. It is not implemented by Android's bionic C library for 64-bit platforms. Use the more portable strchr() function from C89. Signed-off-by: Alistair Strachan <astrachan@google.com> --- testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)