mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
tst-tzset: output reason when creating 4GiB file fails
Currently, if the temporary file creation fails the create_tz_file function returns NULL. The NULL pointer is then passed to setenv which causes a SIGSEGV. Rather than failing with a SIGSEGV print a warning and exit.
This commit is contained in:
parent
d672a98a1a
commit
afbf26492a
@ -25,6 +25,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <support/check.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
static int do_test (void);
|
||||
#define TEST_FUNCTION do_test ()
|
||||
@ -103,6 +104,13 @@ static void
|
||||
test_tz_file (off64_t size)
|
||||
{
|
||||
char *path = create_tz_file (size);
|
||||
if (path == NULL)
|
||||
{
|
||||
printf ("creating timezone file of size: %" PRId64 "MiB failed.\n",
|
||||
size / (1024 * 1024));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (setenv ("TZ", path, 1) < 0)
|
||||
{
|
||||
printf ("setenv failed: %m\n");
|
||||
|
Loading…
Reference in New Issue
Block a user