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:
@@ -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
|
||||
|
Reference in New Issue
Block a user