summaryrefslogtreecommitdiff
path: root/glnx-dirfd.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-11-08 11:05:12 +0000
committerSimon McVittie <smcv@collabora.com>2022-11-08 11:17:41 +0000
commitea18312ed03e0077740e327966a8e0e5810d7f5b (patch)
tree25f3c4e0e0dd4244b87ddcff3715e465287f5a79 /glnx-dirfd.c
parent4e44fd9c174e4196a86fb6d954722feaff612c88 (diff)
downloadlibglnx-ea18312ed03e0077740e327966a8e0e5810d7f5b.tar.gz
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 <smcv@collabora.com>
Diffstat (limited to 'glnx-dirfd.c')
-rw-r--r--glnx-dirfd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/glnx-dirfd.c b/glnx-dirfd.c
index b039c41..b78e2df 100644
--- a/glnx-dirfd.c
+++ b/glnx-dirfd.c
@@ -129,7 +129,7 @@ glnx_dirfd_iterator_init_take_fd (int *dfd,
if (!d)
return glnx_throw_errno_prefix (error, "fdopendir");
- real_dfd_iter->fd = glnx_steal_fd (dfd);
+ real_dfd_iter->fd = g_steal_fd (dfd);
real_dfd_iter->d = d;
real_dfd_iter->initialized = TRUE;
@@ -349,7 +349,7 @@ glnx_mkdtempat (int dfd, const char *tmpl, int mode,
/* Return the initialized directory struct */
out_tmpdir->initialized = TRUE;
out_tmpdir->src_dfd = dfd; /* referenced; see above docs */
- out_tmpdir->fd = glnx_steal_fd (&ret_dfd);
+ out_tmpdir->fd = g_steal_fd (&ret_dfd);
out_tmpdir->path = g_steal_pointer (&path);
return TRUE;
}