aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/compat.c')
-rw-r--r--src/common/compat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index eb9a70f580..278e5c5241 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -990,14 +990,14 @@ tor_fd_seekend(int fd)
#ifdef _WIN32
return _lseek(fd, 0, SEEK_END) < 0 ? -1 : 0;
#else
- int rc = lseek(fd, 0, SEEK_END) < 0 ? -1 : 0;
+ off_t rc = lseek(fd, 0, SEEK_END) < 0 ? -1 : 0;
#ifdef ESPIPE
/* If we get an error and ESPIPE, then it's a pipe or a socket of a fifo:
* no need to worry. */
if (rc < 0 && errno == ESPIPE)
rc = 0;
#endif
- return rc;
+ return (rc < 0) ? -1 : 0;
#endif
}