unlink the temporary file immediately after calling mkstemp

This commit is contained in:
Kazuho Oku 2014-12-22 07:24:36 +09:00
parent eb6ba2a703
commit 125f62b71e
1 changed files with 4 additions and 0 deletions

View File

@ -2096,6 +2096,10 @@ int run(char **uris, int n) {
<< std::endl;
return 1;
}
if (unlink(tempfn) != 0) {
std::cerr << "[WARNING] failed to unlink temporary file:" << tempfn
<< std::endl;
}
while (1) {
char buf[1024];
ssize_t rret, wret;