diff options
author | Simon McVittie <smcv@collabora.com> | 2022-11-08 11:05:12 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2022-11-08 11:17:41 +0000 |
commit | ea18312ed03e0077740e327966a8e0e5810d7f5b (patch) | |
tree | 25f3c4e0e0dd4244b87ddcff3715e465287f5a79 /glnx-dirfd.c | |
parent | 4e44fd9c174e4196a86fb6d954722feaff612c88 (diff) | |
download | libglnx-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.c | 4 |
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; } |