[gnome-builder/wip/gtk4-port: 1389/1774] libide/foundry: start memfd at 0 position




commit 8cc54439224301738788f044dd4284bbb015f0ef
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 7 11:42:11 2022 -0700

    libide/foundry: start memfd at 0 position
    
    In case the other side is reading from these, we always want them to be
    at the 0 position so they can read the contents as they'd expect to.

 src/libide/foundry/ide-foundry-global.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/libide/foundry/ide-foundry-global.c b/src/libide/foundry/ide-foundry-global.c
index cf0048bce..1051118ed 100644
--- a/src/libide/foundry/ide-foundry-global.c
+++ b/src/libide/foundry/ide-foundry-global.c
@@ -239,6 +239,9 @@ ide_foundry_bytes_to_memfd (GBytes     *bytes,
       return -1;
     }
 
+  /* Make sure we are set at the start */
+  lseek (fd, SEEK_SET, 0);
+
   return fd;
 }
 


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