diff options
author | Philip Withnall <pwithnall@gnome.org> | 2024-10-01 14:19:30 +0100 |
---|---|---|
committer | Philip Withnall <pwithnall@gnome.org> | 2024-10-01 14:29:25 +0100 |
commit | f9d1f614a901208a2d4cd2c27e42f30b9c035db7 (patch) | |
tree | 490ca1e64925f734f4b5b48b1724c5b980a86626 | |
parent | a960725b5d16bc1a83a20eec18e4f75ee2e83bd1 (diff) |
gmain: Move doc comment for g_steal_fd() to be next to the code
Nobody’s going to keep it up to date if it’s floating about in an
unrelated place, not next to the code.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
-rw-r--r-- | glib/gmain.c | 21 | ||||
-rw-r--r-- | glib/gmain.h | 21 |
2 files changed, 21 insertions, 21 deletions
diff --git a/glib/gmain.c b/glib/gmain.c index 3010b7984..84ecd6102 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -6571,24 +6571,3 @@ g_get_worker_context (void) return glib_worker_context; } -/** - * g_steal_fd: - * @fd_ptr: (not optional) (inout): A pointer to a file descriptor - * - * Sets @fd_ptr to `-1`, returning the value that was there before. - * - * Conceptually, this transfers the ownership of the file descriptor - * from the referenced variable to the caller of the function (i.e. - * ‘steals’ the reference). This is very similar to [func@GLib.steal_pointer], - * but for file descriptors. - * - * On POSIX platforms, this function is async-signal safe - * (see [`signal(7)`](man:signal(7)) and - * [`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a - * signal handler or a #GSpawnChildSetupFunc. - * - * This function preserves the value of `errno`. - * - * Returns: the value that @fd_ptr previously had - * Since: 2.70 - */ diff --git a/glib/gmain.h b/glib/gmain.h index 94a33fc3c..0c333c0cd 100644 --- a/glib/gmain.h +++ b/glib/gmain.h @@ -984,6 +984,27 @@ void g_main_context_invoke (GMainContext *context, GSourceFunc function, gpointer data); +/** + * g_steal_fd: + * @fd_ptr: (not optional) (inout): A pointer to a file descriptor + * + * Sets @fd_ptr to `-1`, returning the value that was there before. + * + * Conceptually, this transfers the ownership of the file descriptor + * from the referenced variable to the caller of the function (i.e. + * ‘steals’ the reference). This is very similar to [func@GLib.steal_pointer], + * but for file descriptors. + * + * On POSIX platforms, this function is async-signal safe + * (see [`signal(7)`](man:signal(7)) and + * [`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a + * signal handler or a #GSpawnChildSetupFunc. + * + * This function preserves the value of `errno`. + * + * Returns: the value that @fd_ptr previously had + * Since: 2.70 + */ GLIB_AVAILABLE_STATIC_INLINE_IN_2_70 static inline int g_steal_fd (int *fd_ptr); |