[gnome-builder/wip/gtk4-port] libide/core: add ide_steal_fd() macro
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/core: add ide_steal_fd() macro
- Date: Thu, 16 Jun 2022 23:29:05 +0000 (UTC)
commit 462a8671a87f52fde17ad00db60319b6f0971812
Author: Christian Hergert <chergert redhat com>
Date: Thu Jun 16 14:28:51 2022 -0700
libide/core: add ide_steal_fd() macro
This is meant to cleanup some code where we swap fd values for -1.
src/libide/core/ide-macros.h | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/src/libide/core/ide-macros.h b/src/libide/core/ide-macros.h
index 3268066b7..8c20d858d 100644
--- a/src/libide/core/ide-macros.h
+++ b/src/libide/core/ide-macros.h
@@ -301,6 +301,14 @@ ide_strv_sort (char **strv,
NULL);
}
+static inline int
+ide_steal_fd (int *fd)
+{
+ int ret = *fd;
+ *fd = -1;
+ return ret;
+}
+
G_END_DECLS
#endif /* __GI_SCANNER__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]