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:
Colin Walters authored and Atomic Bot committed 2017-10-11 19:26:10 +00:00
1 parent 3e3d28632d
commit 1825f03fe7
29 files changed
+116 -137

No files matched your search

+4 -8
View File
@@ -296,11 +296,7 @@ _ostree_sysroot_bump_mtime (OstreeSysroot *self,
void
ostree_sysroot_unload (OstreeSysroot *self)
{
if (self->sysroot_fd != -1)
{
(void) close (self->sysroot_fd);
self->sysroot_fd = -1;
}
glnx_close_fd (&self->sysroot_fd);
}
/**
@@ -638,7 +634,7 @@ parse_deployment (OstreeSysroot *self,
&treecsum, &deployserial, error))
return FALSE;
glnx_fd_close int deployment_dfd = -1;
glnx_autofd int deployment_dfd = -1;
if (!glnx_opendirat (self->sysroot_fd, relative_boot_link, TRUE,
&deployment_dfd, error))
return FALSE;
@@ -1438,7 +1434,7 @@ ostree_sysroot_init_osname (OstreeSysroot *self,
if (mkdirat (self->sysroot_fd, deploydir, 0777) < 0)
return glnx_throw_errno_prefix (error, "Creating %s", deploydir);
glnx_fd_close int dfd = -1;
glnx_autofd int dfd = -1;
if (!glnx_opendirat (self->sysroot_fd, deploydir, TRUE, &dfd, error))
return FALSE;
@@ -1694,7 +1690,7 @@ ostree_sysroot_deployment_unlock (OstreeSysroot *self,
return FALSE;
g_autofree char *deployment_path = ostree_sysroot_get_deployment_dirpath (self, deployment);
glnx_fd_close int deployment_dfd = -1;
glnx_autofd int deployment_dfd = -1;
if (!glnx_opendirat (self->sysroot_fd, deployment_path, TRUE, &deployment_dfd, error))
return FALSE;