Merge branch 'maint-0.3.5' into maint-0.4.2

This commit is contained in:
Nick Mathewson 2020-07-29 12:37:07 -04:00
commit cdb0e6c252
2 changed files with 6 additions and 3 deletions

3
changes/bug31036 Normal file
View File

@ -0,0 +1,3 @@
o Minor bugfixes (windows):
- Fix a bug that prevented Tor from starting if its log file
grew above 2GB. Fixes bug 31036; bugfix on 0.2.1.8-alpha.

View File

@ -47,7 +47,7 @@ off_t
tor_fd_getpos(int fd) tor_fd_getpos(int fd)
{ {
#ifdef _WIN32 #ifdef _WIN32
return (off_t) _lseek(fd, 0, SEEK_CUR); return (off_t) _lseeki64(fd, 0, SEEK_CUR);
#else #else
return (off_t) lseek(fd, 0, SEEK_CUR); return (off_t) lseek(fd, 0, SEEK_CUR);
#endif #endif
@ -60,7 +60,7 @@ int
tor_fd_seekend(int fd) tor_fd_seekend(int fd)
{ {
#ifdef _WIN32 #ifdef _WIN32
return _lseek(fd, 0, SEEK_END) < 0 ? -1 : 0; return _lseeki64(fd, 0, SEEK_END) < 0 ? -1 : 0;
#else #else
off_t rc = lseek(fd, 0, SEEK_END) < 0 ? -1 : 0; off_t rc = lseek(fd, 0, SEEK_END) < 0 ? -1 : 0;
#ifdef ESPIPE #ifdef ESPIPE
@ -79,7 +79,7 @@ int
tor_fd_setpos(int fd, off_t pos) tor_fd_setpos(int fd, off_t pos)
{ {
#ifdef _WIN32 #ifdef _WIN32
return _lseek(fd, pos, SEEK_SET) < 0 ? -1 : 0; return _lseeki64(fd, pos, SEEK_SET) < 0 ? -1 : 0;
#else #else
return lseek(fd, pos, SEEK_SET) < 0 ? -1 : 0; return lseek(fd, pos, SEEK_SET) < 0 ? -1 : 0;
#endif #endif