lib: Rename function for staging dir check

Rename the function to more accurately reflect what it does, which is to
check whether the filename has the `staging-` prefix.
This commit is contained in:
Jonathan Lebon 2020-04-17 14:20:25 -04:00
parent bb8fd5a2c4
commit df065ad766
3 changed files with 4 additions and 4 deletions

View File

@ -2011,7 +2011,7 @@ cleanup_tmpdir (OstreeRepo *self,
continue;
/* Handle transaction tmpdirs */
if (_ostree_repo_is_locked_tmpdir (dent->d_name))
if (_ostree_repo_has_staging_prefix (dent->d_name))
{
if (!cleanup_txn_dir (self, dfd_iter.fd, dent->d_name, cancellable, error))
return FALSE;

View File

@ -247,7 +247,7 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd,
GError **error);
gboolean
_ostree_repo_is_locked_tmpdir (const char *filename);
_ostree_repo_has_staging_prefix (const char *filename);
gboolean
_ostree_repo_try_lock_tmpdir (int tmpdir_dfd,

View File

@ -5959,7 +5959,7 @@ _ostree_repo_maybe_regenerate_summary (OstreeRepo *self,
}
gboolean
_ostree_repo_is_locked_tmpdir (const char *filename)
_ostree_repo_has_staging_prefix (const char *filename)
{
return g_str_has_prefix (filename, OSTREE_REPO_TMPDIR_STAGING);
}
@ -6019,7 +6019,7 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd,
GCancellable *cancellable,
GError **error)
{
g_return_val_if_fail (_ostree_repo_is_locked_tmpdir (tmpdir_prefix), FALSE);
g_return_val_if_fail (_ostree_repo_has_staging_prefix (tmpdir_prefix), FALSE);
/* Look for existing tmpdir (with same prefix) to reuse */
g_auto(GLnxDirFdIterator) dfd_iter = { 0, };