From ca3a04f65d2b31ab55364c7dc2a82cff8aa20b0d Mon Sep 17 00:00:00 2001 From: Christian Biesinger Date: Sat, 2 Nov 2019 12:09:31 -0500 Subject: Use strtok_r instead of strtok Improves threadsafety. This will be important when the patch series at https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/176 lands. gdb/ChangeLog: 2019-11-06 Christian Biesinger * linux-tdep.c (linux_info_proc): Use strtok_r instead of strtok. * mi/mi-main.c (output_cores): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_cpus): Likewise. (linux_xfer_osdata_modules): Likewise. * remote.c (register_remote_support_xml): Likewise. * sparc64-tdep.c (adi_is_addr_mapped): Likewise. * xml-syscall.c (syscall_create_syscall_desc): Likewise. gdb/gdbserver/ChangeLog: 2019-11-06 Christian Biesinger * linux-x86-low.c (x86_linux_process_qsupported): Use strtok_r instead of strtok. * server.c (handle_query): Likewise. (captured_main): Likewise. Change-Id: Ief6138965a24398e5fc064598cd8f2abd3b5047c --- gdb/xml-syscall.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/xml-syscall.c') diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c index dc988df..3830faa 100644 --- a/gdb/xml-syscall.c +++ b/gdb/xml-syscall.c @@ -221,9 +221,10 @@ syscall_create_syscall_desc (struct syscalls_info *syscalls_info, /* Add syscall to its groups. */ if (groups != NULL) { - for (char *group = strtok (groups, ","); + char *saveptr; + for (char *group = strtok_r (groups, ",", &saveptr); group != NULL; - group = strtok (NULL, ",")) + group = strtok_r (NULL, ",", &saveptr)) syscall_group_add_syscall (syscalls_info, sysdesc, group); } } -- cgit v1.1