summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--userland/httpd/httpd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/userland/httpd/httpd.c b/userland/httpd/httpd.c
index e65dcf8..9593caf 100644
--- a/userland/httpd/httpd.c
+++ b/userland/httpd/httpd.c
@@ -98,6 +98,9 @@ void request_try_file(struct http_request *request, const char *path) {
request->status_code = 404;
return;
}
+ if (-1 != request->file_fd) {
+ close(request->file_fd);
+ }
request->file_fd = fd;
struct stat statbuf;
if (-1 == fstat(request->file_fd, &statbuf)) {