Skip to content
Snippets Groups Projects
Commit 4e996999 authored by Alexander Larsson's avatar Alexander Larsson
Browse files

Add glnx_steal_fd

This is very useful in combination with glnx_close_fd

https://bugzilla.gnome.org/show_bug.cgi?id=757611
parent bf4d1504
No related branches found
No related tags found
No related merge requests found
...@@ -211,4 +211,12 @@ glnx_cleanup_close_fdp (int *fdp) ...@@ -211,4 +211,12 @@ glnx_cleanup_close_fdp (int *fdp)
*/ */
#define glnx_fd_close __attribute__((cleanup(glnx_cleanup_close_fdp))) #define glnx_fd_close __attribute__((cleanup(glnx_cleanup_close_fdp)))
static inline int
glnx_steal_fd (int *fdp)
{
int fd = *fdp;
*fdp = -1;
return fd;
}
G_END_DECLS G_END_DECLS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment