From: Alistair Strachan <astrachan@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] cpuset_lib: Replace index() with strchr()
Date: Wed, 11 Jul 2018 09:49:24 -0700 [thread overview]
Message-ID: <20180711164925.65342-1-astrachan@google.com> (raw)
In-Reply-To: <20180703091057.pfvdfxelb2u6cewi@dell5510>
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(-)
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++;
next prev parent reply other threads:[~2018-07-11 16:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-24 20:34 [LTP] [PATCH] verify_caps_exec: Replace index() with strchr() Alistair Strachan
2018-07-03 9:10 ` Petr Vorel
2018-07-11 16:49 ` Alistair Strachan [this message]
2018-07-11 16:49 ` [LTP] [PATCH] pounder21: Replace {r,}index() with str{r,}chr() Alistair Strachan
2018-07-23 12:06 ` Petr Vorel
2018-07-23 11:54 ` [LTP] [PATCH] cpuset_lib: Replace index() with strchr() Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180711164925.65342-1-astrachan@google.com \
--to=astrachan@google.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox