diff options
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r-- | src/microhttpd/response.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index 4a6382f8..32e679f4 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -329,11 +329,16 @@ file_reader (void *cls, uint64_t pos, char *buf, size_t max) | |||
329 | if (offset64 < 0) | 329 | if (offset64 < 0) |
330 | return MHD_CONTENT_READER_END_WITH_ERROR; /* seek to required position is not possible */ | 330 | return MHD_CONTENT_READER_END_WITH_ERROR; /* seek to required position is not possible */ |
331 | 331 | ||
332 | #if defined(HAVE___LSEEKI64) | ||
333 | if (_lseeki64 (response->fd, offset64, SEEK_SET) != offset64) | ||
334 | return MHD_CONTENT_READER_END_WITH_ERROR; /* can't seek to required position */ | ||
335 | #else /* !HAVE___LSEEKI64 */ | ||
332 | if (sizeof(off_t) < sizeof(uint64_t) && offset64 > (uint64_t)INT32_MAX) | 336 | if (sizeof(off_t) < sizeof(uint64_t) && offset64 > (uint64_t)INT32_MAX) |
333 | return MHD_CONTENT_READER_END_WITH_ERROR; /* seek to required position is not possible */ | 337 | return MHD_CONTENT_READER_END_WITH_ERROR; /* seek to required position is not possible */ |
334 | 338 | ||
335 | if (lseek (response->fd, (off_t)offset64, SEEK_SET) != (off_t)offset64) | 339 | if (lseek (response->fd, (off_t)offset64, SEEK_SET) != (off_t)offset64) |
336 | return MHD_CONTENT_READER_END_WITH_ERROR; /* can't seek to required position */ | 340 | return MHD_CONTENT_READER_END_WITH_ERROR; /* can't seek to required position */ |
341 | #endif | ||
337 | 342 | ||
338 | n = read (response->fd, buf, max); | 343 | n = read (response->fd, buf, max); |
339 | if (0 == n) | 344 | if (0 == n) |