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
@@ -1229,7 +1229,7 @@ rename_pending_loose_objects (OstreeRepo *self,
|
||||
/* Ensure that in the case of a power cut all the directory metadata that
|
||||
we want has reached the disk. In particular, we want this before we
|
||||
update the refs to point to these objects. */
|
||||
glnx_fd_close int target_dir_fd = -1;
|
||||
glnx_autofd int target_dir_fd = -1;
|
||||
|
||||
loose_objpath[2] = 0;
|
||||
|
||||
@@ -2221,7 +2221,7 @@ ostree_repo_read_commit_detached_metadata (OstreeRepo *self,
|
||||
|
||||
if (self->commit_stagedir.initialized)
|
||||
{
|
||||
glnx_fd_close int fd = -1;
|
||||
glnx_autofd int fd = -1;
|
||||
if (!ot_openat_ignore_enoent (self->commit_stagedir.fd, buf, &fd, error))
|
||||
return FALSE;
|
||||
if (fd != -1)
|
||||
@@ -2229,7 +2229,7 @@ ostree_repo_read_commit_detached_metadata (OstreeRepo *self,
|
||||
out_metadata, error);
|
||||
}
|
||||
|
||||
glnx_fd_close int fd = -1;
|
||||
glnx_autofd int fd = -1;
|
||||
if (!ot_openat_ignore_enoent (self->objects_dir_fd, buf, &fd, error))
|
||||
return FALSE;
|
||||
if (fd != -1)
|
||||
@@ -3404,7 +3404,7 @@ import_one_object_direct (OstreeRepo *dest_repo,
|
||||
* that basically just optionally does chown(). Perhaps
|
||||
* in the future we should add flags for those things?
|
||||
*/
|
||||
glnx_fd_close int src_fd = -1;
|
||||
glnx_autofd int src_fd = -1;
|
||||
if (!glnx_openat_rdonly (src_repo->objects_dir_fd, loose_path_buf,
|
||||
FALSE, &src_fd, error))
|
||||
return FALSE;
|
||||
|
||||
Reference in new issue
Block a user