mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-28 11:54:01 -04:00
Add glnx_steal_fd
This is very useful in combination with glnx_close_fd https://bugzilla.gnome.org/show_bug.cgi?id=757611
This commit is contained in:
@@ -211,4 +211,12 @@ glnx_cleanup_close_fdp (int *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
|
||||
|
||||
Reference in New Issue
Block a user