From 125f62b71e464ccc6669c40a2e4e9a07d9ea0537 Mon Sep 17 00:00:00 2001 From: Kazuho Oku Date: Mon, 22 Dec 2014 07:24:36 +0900 Subject: [PATCH] unlink the temporary file immediately after calling mkstemp --- src/nghttp.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nghttp.cc b/src/nghttp.cc index b4e39a12..1aac801a 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -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;