mirror of
https://github.com/ostreedev/ostree.git
synced 2024-12-22 17:35:55 +03:00
sysroot: Add ostree_sysroot_get_fd()
This way external programs like rpm-ostree can do fd-relative operations on the deployment directories, like inspecting the RPM database. Closes: https://github.com/GNOME/ostree/pull/91
This commit is contained in:
parent
60ebec770e
commit
24087d477c
@ -365,6 +365,7 @@ ostree_sysroot_new
|
||||
ostree_sysroot_new_default
|
||||
ostree_sysroot_get_path
|
||||
ostree_sysroot_load
|
||||
ostree_sysroot_get_fd
|
||||
ostree_sysroot_ensure_initialized
|
||||
ostree_sysroot_get_bootversion
|
||||
ostree_sysroot_get_subbootversion
|
||||
|
@ -196,6 +196,23 @@ ensure_sysroot_fd (OstreeSysroot *self,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ostree_sysroot_get_fd:
|
||||
* @self: Sysroot
|
||||
*
|
||||
* Access a file descriptor that refers to the root directory of this
|
||||
* sysroot. ostree_sysroot_load() must have been invoked prior to
|
||||
* calling this function.
|
||||
*
|
||||
* Returns: A file descriptor valid for the lifetime of @self
|
||||
*/
|
||||
int
|
||||
ostree_sysroot_get_fd (OstreeSysroot *self)
|
||||
{
|
||||
g_return_val_if_fail (self->sysroot_fd != -1, -1);
|
||||
return self->sysroot_fd;
|
||||
}
|
||||
|
||||
/**
|
||||
* ostree_sysroot_ensure_initialized:
|
||||
* @self: Sysroot
|
||||
|
@ -39,6 +39,8 @@ OstreeSysroot* ostree_sysroot_new_default (void);
|
||||
|
||||
GFile *ostree_sysroot_get_path (OstreeSysroot *self);
|
||||
|
||||
int ostree_sysroot_get_fd (OstreeSysroot *self);
|
||||
|
||||
gboolean ostree_sysroot_load (OstreeSysroot *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
Loading…
Reference in New Issue
Block a user