aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-07-29 12:37:07 -0400
committerNick Mathewson <nickm@torproject.org>2020-07-29 12:37:07 -0400
commit5f4601f5aa388f25c63faf9822f7dfcfab09f34c (patch)
treec22e5a8f2aa73e4018b795b7532df3a4508ec691
parent061fcce5d5741c1f86ef40c6c79c073784ce7875 (diff)
parentcdb0e6c2522aac372c9a816300dacfd62856dd48 (diff)
downloadtor-5f4601f5aa388f25c63faf9822f7dfcfab09f34c.tar.gz
tor-5f4601f5aa388f25c63faf9822f7dfcfab09f34c.zip
Merge branch 'maint-0.4.2' into release-0.4.2
-rw-r--r--changes/bug310363
-rw-r--r--src/lib/fdio/fdio.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/changes/bug31036 b/changes/bug31036
new file mode 100644
index 0000000000..d9921dba43
--- /dev/null
+++ b/changes/bug31036
@@ -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.
diff --git a/src/lib/fdio/fdio.c b/src/lib/fdio/fdio.c
index 078af6a9ba..2d0864cc19 100644
--- a/src/lib/fdio/fdio.c
+++ b/src/lib/fdio/fdio.c
@@ -47,7 +47,7 @@ off_t
tor_fd_getpos(int fd)
{
#ifdef _WIN32
- return (off_t) _lseek(fd, 0, SEEK_CUR);
+ return (off_t) _lseeki64(fd, 0, SEEK_CUR);
#else
return (off_t) lseek(fd, 0, SEEK_CUR);
#endif
@@ -60,7 +60,7 @@ int
tor_fd_seekend(int fd)
{
#ifdef _WIN32
- return _lseek(fd, 0, SEEK_END) < 0 ? -1 : 0;
+ return _lseeki64(fd, 0, SEEK_END) < 0 ? -1 : 0;
#else
off_t rc = lseek(fd, 0, SEEK_END) < 0 ? -1 : 0;
#ifdef ESPIPE
@@ -79,7 +79,7 @@ int
tor_fd_setpos(int fd, off_t pos)
{
#ifdef _WIN32
- return _lseek(fd, pos, SEEK_SET) < 0 ? -1 : 0;
+ return _lseeki64(fd, pos, SEEK_SET) < 0 ? -1 : 0;
#else
return lseek(fd, pos, SEEK_SET) < 0 ? -1 : 0;
#endif