Unlink correct file in upload example.

This commit is contained in:
Joris Vink 2016-01-20 10:33:32 +01:00
parent d67b5aaa04
commit a958627837
1 changed files with 2 additions and 1 deletions

View File

@ -68,6 +68,7 @@ page(struct http_request *req)
}
/* While we have data from http_file_read(), write it. */
/* Alternatively you could look at file->offset and file->length. */
ret = KORE_RESULT_ERROR;
for (;;) {
ret = http_file_read(file, buf, sizeof(buf));
@ -106,7 +107,7 @@ cleanup:
kore_log(LOG_WARNING, "close(%s): %s", file->filename, errno_s);
if (ret == KORE_RESULT_ERROR) {
if (unlink("dump") == -1) {
if (unlink(file->filename) == -1) {
kore_log(LOG_WARNING, "unlink(%s): %s",
file->filename, errno_s);
}