[core] always set file.fd = -1 on FILE_CHUNK reset (fixes #3044)
(thx flynn) x-ref: "Socket errors after update to version 1.4.56" https://redmine.lighttpd.net/issues/3044
This commit is contained in:
parent
d15e2286f2
commit
1d9cab1bc3
|
@ -107,13 +107,13 @@ static void chunk_reset_file_chunk(chunk *c) {
|
|||
}
|
||||
else if (c->file.fd != -1) {
|
||||
close(c->file.fd);
|
||||
c->file.fd = -1;
|
||||
}
|
||||
if (MAP_FAILED != c->file.mmap.start) {
|
||||
munmap(c->file.mmap.start, c->file.mmap.length);
|
||||
c->file.mmap.start = MAP_FAILED;
|
||||
c->file.mmap.length = c->file.mmap.offset = 0;
|
||||
}
|
||||
c->file.fd = -1;
|
||||
c->file.length = 0;
|
||||
c->type = MEM_CHUNK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue