summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libgloss/m68k/io-lseek.c2
-rw-r--r--libgloss/nios2/io-lseek.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libgloss/m68k/io-lseek.c b/libgloss/m68k/io-lseek.c
index 63ec56451..eaaf55746 100644
--- a/libgloss/m68k/io-lseek.c
+++ b/libgloss/m68k/io-lseek.c
@@ -38,7 +38,7 @@ off_t lseek (int fd, off_t offset, int whence)
#if HOSTED
gdb_parambuf_t parameters;
parameters[0] = (uint32_t) fd;
- parameters[1] = (uint32_t) ((offset >> 32) & 0xffffffff);
+ parameters[1] = (uint32_t) ((int64_t)offset >> 32);
parameters[2] = (uint32_t) (offset & 0xffffffff);
parameters[3] = __hosted_to_gdb_lseek_flags (whence);
__hosted (HOSTED_LSEEK, parameters);
diff --git a/libgloss/nios2/io-lseek.c b/libgloss/nios2/io-lseek.c
index bfc23c1bc..d47fe0798 100644
--- a/libgloss/nios2/io-lseek.c
+++ b/libgloss/nios2/io-lseek.c
@@ -39,7 +39,7 @@ off_t lseek (int fd, off_t offset, int whence)
#if HOSTED
gdb_parambuf_t parameters;
parameters[0] = (uint32_t) fd;
- parameters[1] = (uint32_t) ((offset >> 32) & 0xffffffff);
+ parameters[1] = (uint32_t) ((int64_t)offset >> 32);
parameters[2] = (uint32_t) (offset & 0xffffffff);
parameters[3] = __hosted_to_gdb_lseek_flags (whence);
__io_hosted (HOSTED_LSEEK, parameters);