asio-sv2: Fix compile error with OS X

Use struct stat.st_mtime instead of st_mtim which seems to be Linux
specific.
This commit is contained in:
Tatsuhiro Tsujikawa 2015-02-21 21:02:40 +09:00
parent c84a190ac7
commit 3144f7de72
1 changed files with 1 additions and 2 deletions

View File

@ -93,8 +93,7 @@ int main(int argc, char *argv[]) {
if (stat(path.c_str(), &stbuf) == 0) { if (stat(path.c_str(), &stbuf) == 0) {
headers.push_back( headers.push_back(
header{"content-length", std::to_string(stbuf.st_size)}); header{"content-length", std::to_string(stbuf.st_size)});
headers.push_back( headers.push_back(header{"last-modified", http_date(stbuf.st_mtime)});
header{"last-modified", http_date(stbuf.st_mtim.tv_sec)});
} }
res->write_head(200, std::move(headers)); res->write_head(200, std::move(headers));
res->end(file_reader_from_fd(fd)); res->end(file_reader_from_fd(fd));