[glib/nacho/off_t: 1/2] giowin32: use gint64 and _lseeki64




commit 43aea8a3394194dc9ea7de56efbd623f375360a5
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Thu Jan 20 11:07:20 2022 +0100

    giowin32: use gint64 and _lseeki64
    
    off_t on windows is 32bit which means that it will not be able
    to handle big offsets

 glib/giowin32.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/glib/giowin32.c b/glib/giowin32.c
index 6afd48e61..618a50ad9 100644
--- a/glib/giowin32.c
+++ b/glib/giowin32.c
@@ -1291,8 +1291,8 @@ g_io_win32_fd_seek (GIOChannel *channel,
 {
   GIOWin32Channel *win32_channel = (GIOWin32Channel *)channel;
   int whence, errsv;
-  off_t tmp_offset;
-  off_t result;
+  gint64 tmp_offset;
+  gint64 result;
   
   switch (type)
     {
@@ -1320,7 +1320,7 @@ g_io_win32_fd_seek (GIOChannel *channel,
       return G_IO_STATUS_ERROR;
     }
 
-  result = lseek (win32_channel->fd, tmp_offset, whence);
+  result = _lseeki64 (win32_channel->fd, tmp_offset, whence);
   errsv = errno;
   
   if (result < 0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]