Constify get_exec_file
[deliverable/binutils-gdb.git] / gdb / gdbserver / server.c
index 25a2be86fb0bb5e273eae3495ab312cb27e200cf..a425fbaa013702b727e2d7c94d630a1e957adaf2 100644 (file)
@@ -79,7 +79,7 @@ static bool exit_requested;
 /* --once: Exit after the first connection has closed.  */
 bool run_once;
 
-/* Whether to report TARGET_WAITKING_NO_RESUMED events.  */
+/* Whether to report TARGET_WAITKIND_NO_RESUMED events.  */
 static bool report_no_resumed;
 
 bool non_stop;
@@ -265,7 +265,7 @@ get_exec_wrapper ()
 
 /* See gdbsupport/common-inferior.h.  */
 
-char *
+const char *
 get_exec_file (int err)
 {
   if (err && program_path.get () == NULL)
@@ -2268,9 +2268,10 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
 
          /* Two passes, to avoid nested strtok calls in
             target_process_qsupported.  */
-         for (p = strtok (p + 1, ";");
+         char *saveptr;
+         for (p = strtok_r (p + 1, ";", &saveptr);
               p != NULL;
-              p = strtok (NULL, ";"))
+              p = strtok_r (NULL, ";", &saveptr))
            {
              count++;
              qsupported = XRESIZEVEC (char *, qsupported, count);
@@ -3633,12 +3634,11 @@ captured_main (int argc, char *argv[])
        }
       else if (startswith (*next_arg, "--disable-packet="))
        {
-         char *packets, *tok;
-
-         packets = *next_arg += sizeof ("--disable-packet=") - 1;
-         for (tok = strtok (packets, ",");
+         char *packets = *next_arg += sizeof ("--disable-packet=") - 1;
+         char *saveptr;
+         for (char *tok = strtok_r (packets, ",", &saveptr);
               tok != NULL;
-              tok = strtok (NULL, ","))
+              tok = strtok_r (NULL, ",", &saveptr))
            {
              if (strcmp ("vCont", tok) == 0)
                disable_packet_vCont = true;
This page took 0.035121 seconds and 4 git commands to generate.