From ea18312ed03e0077740e327966a8e0e5810d7f5b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 8 Nov 2022 11:05:12 +0000 Subject: backports: Add g_steal_fd, from GLib >= 2.70 This is essentially the same as glnx_steal_fd, so make glnx_steal_fd an alias for it. The unit test is taken from GLib, slightly modified to avoid g_close() and also test the old name glnx_steal_fd(). Signed-off-by: Simon McVittie --- glnx-fdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'glnx-fdio.c') diff --git a/glnx-fdio.c b/glnx-fdio.c index b1af679..9873205 100644 --- a/glnx-fdio.c +++ b/glnx-fdio.c @@ -218,7 +218,7 @@ open_tmpfile_core (int dfd, const char *subpath, return glnx_throw_errno_prefix (error, "fchmod"); out_tmpf->initialized = TRUE; out_tmpf->src_dfd = dfd; /* Copied; caller must keep open */ - out_tmpf->fd = glnx_steal_fd (&fd); + out_tmpf->fd = g_steal_fd (&fd); out_tmpf->path = NULL; return TRUE; } @@ -245,7 +245,7 @@ open_tmpfile_core (int dfd, const char *subpath, { out_tmpf->initialized = TRUE; out_tmpf->src_dfd = dfd; /* Copied; caller must keep open */ - out_tmpf->fd = glnx_steal_fd (&fd); + out_tmpf->fd = g_steal_fd (&fd); out_tmpf->path = g_steal_pointer (&tmp); return TRUE; } @@ -463,7 +463,7 @@ glnx_tmpfile_reopen_rdonly (GLnxTmpfile *tmpf, } glnx_close_fd (&tmpf->fd); - tmpf->fd = glnx_steal_fd (&rdonly_fd); + tmpf->fd = g_steal_fd (&rdonly_fd); return TRUE; } -- cgit v1.2.1