remove temp files on close
This commit is contained in:
parent
005ee04b9f
commit
3f23048f7b
1 changed files with 7 additions and 1 deletions
|
|
@ -4,6 +4,12 @@
|
||||||
int
|
int
|
||||||
opentemp(char *template)
|
opentemp(char *template)
|
||||||
{
|
{
|
||||||
return mkstemp(template);
|
int fd;
|
||||||
|
|
||||||
|
fd = mkstemp(template);
|
||||||
|
if(fd < 0)
|
||||||
|
return -1;
|
||||||
|
remove(template);
|
||||||
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue