[gnome-builder] libide/threading: add assertions for pipefd usage
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/threading: add assertions for pipefd usage
- Date: Fri, 22 Jul 2022 00:52:45 +0000 (UTC)
commit dbec2c43e7ac5a1442a53e9ffc5414caf7486ed0
Author: Christian Hergert <chergert redhat com>
Date: Thu Jul 21 17:51:57 2022 -0700
libide/threading: add assertions for pipefd usage
src/libide/threading/ide-unix-fd-map.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/libide/threading/ide-unix-fd-map.c b/src/libide/threading/ide-unix-fd-map.c
index 618bd41a6..305604c15 100644
--- a/src/libide/threading/ide-unix-fd-map.c
+++ b/src/libide/threading/ide-unix-fd-map.c
@@ -466,6 +466,11 @@ ide_unix_fd_map_create_stream (IdeUnixFDMap *self,
IDE_GOTO (failure);
}
+ g_assert (stdin_pair[0] != -1);
+ g_assert (stdin_pair[1] != -1);
+ g_assert (stdout_pair[0] != -1);
+ g_assert (stdout_pair[1] != -1);
+
ide_unix_fd_map_take (self, ide_steal_fd (&stdin_pair[0]), dest_read_fd);
ide_unix_fd_map_take (self, ide_steal_fd (&stdout_pair[1]), dest_write_fd);
@@ -478,6 +483,11 @@ ide_unix_fd_map_create_stream (IdeUnixFDMap *self,
ret = g_simple_io_stream_new (input, output);
+ g_assert (stdin_pair[0] == -1);
+ g_assert (stdin_pair[1] == -1);
+ g_assert (stdout_pair[0] == -1);
+ g_assert (stdout_pair[1] == -1);
+
failure:
if (stdin_pair[0] != -1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]