1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

support: Add xstrndup, xunlink, xreadlink, support_create_temp_directory

This commit is contained in:
Florian Weimer
2017-11-12 09:53:06 +01:00
parent 456b40a97f
commit 1ffe1ccb6e
11 changed files with 219 additions and 5 deletions

View File

@@ -46,10 +46,11 @@ support_chroot_create (struct support_chroot_configuration conf)
{
struct support_chroot *chroot = xmalloc (sizeof (*chroot));
chroot->path_chroot = xasprintf ("%s/tst-resolv-res_init-XXXXXX", test_dir);
if (mkdtemp (chroot->path_chroot) == NULL)
FAIL_EXIT1 ("mkdtemp (\"%s\"): %m", chroot->path_chroot);
add_temp_file (chroot->path_chroot);
{
char *template = xasprintf ("%s/tst-resolv-res_init-XXXXXX", test_dir);
chroot->path_chroot = support_create_temp_directory (template);
free (template);
}
/* Create the /etc directory in the chroot environment. */
char *path_etc = xasprintf ("%s/etc", chroot->path_chroot);