about summary refs log tree commit diff
path: root/support/support_chroot.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-11-12 09:53:06 +0100
committerFlorian Weimer <fweimer@redhat.com>2017-11-12 09:53:06 +0100
commit1ffe1ccb6ec5771765f1f6f0c439ed07bf345d67 (patch)
treea5d96c2270d9f919e4cda3c17649e5cec4ff519e /support/support_chroot.c
parent456b40a97f7e867803b2f47f5fcd3f1fa4bc1f6e (diff)
downloadglibc-1ffe1ccb6ec5771765f1f6f0c439ed07bf345d67.tar.gz
glibc-1ffe1ccb6ec5771765f1f6f0c439ed07bf345d67.tar.xz
glibc-1ffe1ccb6ec5771765f1f6f0c439ed07bf345d67.zip
support: Add xstrndup, xunlink, xreadlink, support_create_temp_directory
Diffstat (limited to 'support/support_chroot.c')
-rw-r--r--support/support_chroot.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/support/support_chroot.c b/support/support_chroot.c
index f3ef551b05..f6fad18f33 100644
--- a/support/support_chroot.c
+++ b/support/support_chroot.c
@@ -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);