tree-wide: Update to new libglnx fd APIs
This ends up a lot better IMO. This commit is *mostly* just
`s/glnx_close_fd/glnx_autofd`, but there's also a number of hunks like:
```
- if (self->sysroot_fd != -1)
- {
- (void) close (self->sysroot_fd);
- self->sysroot_fd = -1;
- }
+ glnx_close_fd (&self->sysroot_fd);
```
Update submodule: libglnx
Closes: #1259
Approved by: jlebon
This commit is contained in:
1 parent
3e3d28632d
commit
1825f03fe7
29 files changed
+116
-137
No files matched your search
@@ -79,7 +79,7 @@ ot_openat_read_stream (int dfd,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
glnx_fd_close int fd = -1;
|
||||
glnx_autofd int fd = -1;
|
||||
if (!glnx_openat_rdonly (dfd, path, follow, &fd, error))
|
||||
return FALSE;
|
||||
*out_istream = g_unix_input_stream_new (glnx_steal_fd (&fd), TRUE);
|
||||
@@ -127,7 +127,7 @@ ot_dfd_iter_init_allow_noent (int dfd,
|
||||
gboolean *out_exists,
|
||||
GError **error)
|
||||
{
|
||||
glnx_fd_close int fd = glnx_opendirat_with_errno (dfd, path, TRUE);
|
||||
glnx_autofd int fd = glnx_opendirat_with_errno (dfd, path, TRUE);
|
||||
if (fd < 0)
|
||||
{
|
||||
if (errno != ENOENT)
|
||||
|
||||
Reference in new issue
Block a user