1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +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

@@ -86,6 +86,19 @@ create_temp_file (const char *base, char **filename)
return fd;
}
char *
support_create_temp_directory (const char *base)
{
char *base_copy = xstrdup (base);
if (mkdtemp (base_copy) == NULL)
{
printf ("error: mkdtemp (\"%s\"): %m", base);
exit (1);
}
add_temp_file (base_copy);
return base_copy;
}
/* Helper functions called by the test skeleton follow. */
void