mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 08:58:54 +02:00
gmain: Add g_steal_fd() to API
This is basically glnx_steal_fd() from libglnx. We already had two private implementations of it in GLib. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
committed by
Philip Withnall
parent
46c34ea20f
commit
6c5a227bcc
@@ -781,6 +781,15 @@ void g_main_context_invoke (GMainContext *context,
|
||||
GSourceFunc function,
|
||||
gpointer data);
|
||||
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
|
||||
static inline int
|
||||
g_steal_fd (int *fd_ptr)
|
||||
{
|
||||
int fd = *fd_ptr;
|
||||
*fd_ptr = -1;
|
||||
return fd;
|
||||
}
|
||||
|
||||
/* Hook for GClosure / GSource integration. Don't touch */
|
||||
GLIB_VAR GSourceFuncs g_timeout_funcs;
|
||||
GLIB_VAR GSourceFuncs g_child_watch_funcs;
|
||||
|
Reference in New Issue
Block a user