sysroot: Port origin writing code to fd-relative

Just preparatory cleanup for a next patch which makes
the fsyncing configurable.

Closes: #509
Approved by: giuseppe
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-09-14 10:26:39 +00:00
1 parent 84a9d61e15
commit fcffb73280
3 files changed
+13 -51

No files matched your search

-31
View File
@@ -314,37 +314,6 @@ ot_gfile_ensure_unlinked (GFile *path,
return TRUE;
}
/**
* ot_util_fsync_directory:
* @dir: Path to a directory
* @cancellable: Cancellable
* @error: Error
*
* Ensure that all entries in directory @dir are on disk.
*/
gboolean
ot_util_fsync_directory (GFile *dir,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
glnx_fd_close int dfd = -1;
if (!glnx_opendirat (AT_FDCWD, gs_file_get_path_cached (dir), TRUE,
&dfd, error))
goto out;
if (fsync (dfd) != 0)
{
glnx_set_error_from_errno (error);
goto out;
}
ret = TRUE;
out:
return ret;
}
/**
* ot_util_ensure_directory_and_fsync:
* @dir: Path to a directory
-4
View File
@@ -89,10 +89,6 @@ gboolean ot_util_ensure_directory_and_fsync (GFile *dir,
GCancellable *cancellable,
GError **error);
gboolean ot_util_fsync_directory (GFile *dir,
GCancellable *cancellable,
GError **error);
#if !GLIB_CHECK_VERSION(2, 44, 0)
gboolean
ot_file_enumerator_iterate (GFileEnumerator *direnum,