This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: V2 test-container: ability to specify exec path
- From: Florian Weimer <fweimer at redhat dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 12 Dec 2019 14:18:31 +0100
- Subject: Re: V2 test-container: ability to specify exec path
- References: <xnk172sfm6.fsf@greed.delorie.com>
* DJ Delorie:
> + /* Find the base name of the test. */
> + if (strrchr (test_basename, '/') != NULL)
> + test_basename = strrchr (test_basename, '/') + 1;
Can you use the basename function here?
> + /* If the new exec path ends with a slash, that's the
> + * directory, and use the old test base name. */
> + if (new_exec_path [strlen(new_exec_path) - 1] == '/')
> + new_exec_path = concat (new_exec_path,
> + test_basename,
> + NULL);
> +
> +
> + /* new_child_proc is in the build tree, so has the
> + same path inside the chroot as outside. The new
> + exec path is, by definition, relative to the
> + chroot. */
> + copy_one_file (new_child_proc[0], concat (new_root_path,
> + new_exec_path,
> + NULL));
> +
> + new_child_exec = strdup (new_exec_path);
> + if (the_words[2])
> + new_child_proc[0] = strdup (the_words[2]);
> + else
> + new_child_proc[0] = new_child_exec;
> + }
> + else if (nt == 2 && strcmp (the_words[0], "cwd") == 0)
> + {
> + change_cwd = strdup (the_words[1]);
Use xstrdup (twice)?
Rest looks okay to me, based on cursory glance.
Thanks,
Florian