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:
parent
34065ad404
commit
2ed13d7c7e
@ -721,14 +721,11 @@ gzFile fio_gzopen(char const* path, char const* mode, int* tmp_fd, fio_location
|
|||||||
gzFile file;
|
gzFile file;
|
||||||
if (fio_is_remote(location))
|
if (fio_is_remote(location))
|
||||||
{
|
{
|
||||||
#ifdef P_tmpdir
|
|
||||||
char pattern[] = P_tmpdir "/gz.XXXXXX";
|
|
||||||
#else
|
|
||||||
char pattern[] = "/tmp/gz.XXXXXX";
|
char pattern[] = "/tmp/gz.XXXXXX";
|
||||||
#endif
|
|
||||||
int fd = mkstemp(pattern);
|
int fd = mkstemp(pattern);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
unlink(pattern); /* remove file on close */
|
||||||
if (strcmp(mode, PG_BINARY_W) == 0)
|
if (strcmp(mode, PG_BINARY_W) == 0)
|
||||||
{
|
{
|
||||||
*tmp_fd = fd;
|
*tmp_fd = fd;
|
||||||
|
Loading…
Reference in New Issue
Block a user