You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-07-14 06:54:15 +02:00
Remove temporary files
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user