diff options
Diffstat (limited to 'cmd/ztest/ztest.c')
-rw-r--r-- | cmd/ztest/ztest.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 65cbbe0b4..bc2f56fb8 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -5819,11 +5819,11 @@ ztest_init(ztest_shared_t *zs) static void setup_data_fd(void) { - char *tmp = tempnam(NULL, NULL); - ztest_fd_data = open(tmp, O_RDWR | O_CREAT, 0700); + static char ztest_name_data[] = "/tmp/ztest.data.XXXXXX"; + + ztest_fd_data = mkstemp(ztest_name_data); ASSERT3S(ztest_fd_data, >=, 0); - (void) unlink(tmp); - free(tmp); + (void) unlink(ztest_name_data); } static int |