1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-13 11:53:59 +02:00

Remove temporary files

This commit is contained in:
Konstantin Knizhnik 2019-02-20 13:41:00 +03:00
parent 34065ad404
commit 2ed13d7c7e

View File

@ -721,14 +721,11 @@ gzFile fio_gzopen(char const* path, char const* mode, int* tmp_fd, fio_location
gzFile file;
if (fio_is_remote(location))
{
#ifdef P_tmpdir
char pattern[] = P_tmpdir "/gz.XXXXXX";
#else
char pattern[] = "/tmp/gz.XXXXXX";
#endif
int fd = mkstemp(pattern);
if (fd < 0)
return NULL;
unlink(pattern); /* remove file on close */
if (strcmp(mode, PG_BINARY_W) == 0)
{
*tmp_fd = fd;