Port to libgsystem errno API, hard depend on 2014.3

This is long overdue to make it to libgsystem.  Update our dependency.
This commit is contained in:
Colin Walters committed 2015-01-04 21:17:11 -05:00
1 parent 1bcc7a8e3a
commit 1e8e070102
13 files changed
+71 -84

No files matched your search

+14 -14
View File
@@ -69,7 +69,7 @@ checkout_object_for_uncompressed_cache (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -86,7 +86,7 @@ checkout_object_for_uncompressed_cache (OstreeRepo *self,
{
if (errno != EEXIST)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
g_prefix_error (error, "Storing file '%s': ", temp_filename);
goto out;
}
@@ -130,7 +130,7 @@ write_regular_file_content (OstreeRepoCheckoutMode mode,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -139,7 +139,7 @@ write_regular_file_content (OstreeRepoCheckoutMode mode,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -152,7 +152,7 @@ write_regular_file_content (OstreeRepoCheckoutMode mode,
if (fsync (fd) == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -186,7 +186,7 @@ checkout_file_from_input_at (OstreeRepoCheckoutMode mode,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (res == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -197,7 +197,7 @@ checkout_file_from_input_at (OstreeRepoCheckoutMode mode,
g_file_info_get_attribute_uint32 (file_info, "unix::gid"),
AT_SYMLINK_NOFOLLOW) == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -225,7 +225,7 @@ checkout_file_from_input_at (OstreeRepoCheckoutMode mode,
while (G_UNLIKELY (fd == -1 && errno == EINTR));
if (fd == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
temp_out = g_unix_output_stream_new (fd, TRUE);
@@ -301,7 +301,7 @@ checkout_file_unioning_from_input_at (OstreeRepoCheckoutMode mode,
if (G_UNLIKELY (renameat (destination_dfd, temp_filename,
destination_dfd, destination_name) == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -357,7 +357,7 @@ checkout_file_hardlink (OstreeRepo *self,
else
{
g_prefix_error (error, "Hardlinking %s to %s: ", loose_path, destination_name);
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -578,7 +578,7 @@ checkout_tree_at (OstreeRepo *self,
did_exist = TRUE;
else
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -663,7 +663,7 @@ checkout_tree_at (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -677,7 +677,7 @@ checkout_tree_at (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -690,7 +690,7 @@ checkout_tree_at (OstreeRepo *self,
{
if (fsync (destination_dfd) == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
+11 -11
View File
@@ -51,7 +51,7 @@ _ostree_repo_ensure_loose_objdir_at (int dfd,
int errsv = errno;
if (G_UNLIKELY (errsv != EEXIST))
{
ot_util_set_error_from_errno (error, errsv);
gs_set_error_from_errno (error, errsv);
return FALSE;
}
}
@@ -97,7 +97,7 @@ write_file_metadata_to_xattr (int fd,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
return FALSE;
}
@@ -131,7 +131,7 @@ commit_loose_object_trusted (OstreeRepo *self,
self->target_owner_gid,
AT_SYMLINK_NOFOLLOW) == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -150,7 +150,7 @@ commit_loose_object_trusted (OstreeRepo *self,
g_file_info_get_attribute_uint32 (file_info, "unix::gid"),
AT_SYMLINK_NOFOLLOW) == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -182,7 +182,7 @@ commit_loose_object_trusted (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -191,7 +191,7 @@ commit_loose_object_trusted (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -220,7 +220,7 @@ commit_loose_object_trusted (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -242,7 +242,7 @@ commit_loose_object_trusted (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (G_UNLIKELY (res == -1))
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -254,7 +254,7 @@ commit_loose_object_trusted (OstreeRepo *self,
{
if (fsync (fd) == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -272,7 +272,7 @@ commit_loose_object_trusted (OstreeRepo *self,
{
if (errno != EEXIST)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
g_prefix_error (error, "Storing file '%s': ", temp_filename);
goto out;
}
@@ -422,7 +422,7 @@ fallocate_stream (GFileDescriptorBased *stream,
int r = posix_fallocate (fd, 0, size);
if (r != 0)
{
ot_util_set_error_from_errno (error, r);
gs_set_error_from_errno (error, r);
goto out;
}
}
+7 -7
View File
@@ -1287,7 +1287,7 @@ ostree_repo_open (OstreeRepo *self,
if (fstat (self->objects_dir_fd, &stbuf) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -1554,7 +1554,7 @@ list_loose_objects_at (OstreeRepo *self,
d = fdopendir (dfd);
if (!d)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -1648,7 +1648,7 @@ list_loose_objects (OstreeRepo *self,
continue;
else
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -1798,7 +1798,7 @@ query_info_for_bare_content_object (OstreeRepo *self,
ret = TRUE;
goto out;
}
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -1818,7 +1818,7 @@ query_info_for_bare_content_object (OstreeRepo *self,
while (G_UNLIKELY (len == -1 && errno == EINTR));
if (len == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
targetbuf[len] = '\0';
@@ -2108,7 +2108,7 @@ _ostree_repo_has_loose_object (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (res == -1 && errno != ENOENT)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -2331,7 +2331,7 @@ import_one_object_link (OstreeRepo *self,
ret = TRUE;
}
else
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
+2 -2
View File
@@ -347,7 +347,7 @@ ostree_sepolicy_get_label (OstreeSePolicy *self,
int errsv = errno;
if (errsv != ENOENT)
{
ot_util_set_error_from_errno (error, errsv);
gs_set_error_from_errno (error, errsv);
goto out;
}
}
@@ -440,7 +440,7 @@ ostree_sepolicy_restorecon (OstreeSePolicy *self,
int res = lsetfilecon (gs_file_get_path_cached (target), label);
if (res != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
+21 -21
View File
@@ -79,7 +79,7 @@ copy_one_file_fsync_at (int src_parent_dfd,
src_fd = openat (src_parent_dfd, name, O_RDONLY | O_NOFOLLOW | O_NOCTTY | O_NOATIME | O_CLOEXEC);
if (src_fd == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
in = g_unix_input_stream_new (src_fd, TRUE);
@@ -88,7 +88,7 @@ copy_one_file_fsync_at (int src_parent_dfd,
stbuf->st_mode);
if (dest_fd == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
out = g_unix_output_stream_new (dest_fd, TRUE);
@@ -98,18 +98,18 @@ copy_one_file_fsync_at (int src_parent_dfd,
if (fchown (dest_fd, stbuf->st_uid, stbuf->st_gid) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
if (fchmod (dest_fd, stbuf->st_mode) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
if (fdatasync (dest_fd) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -125,20 +125,20 @@ copy_one_file_fsync_at (int src_parent_dfd,
while (G_UNLIKELY (len == -1 && errno == EINTR));
if (len == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
targetbuf[len] = '\0';
if (symlinkat (targetbuf, dest_parent_dfd, name) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
if (fchownat (dest_parent_dfd, name,
stbuf->st_uid, stbuf->st_gid,
AT_SYMLINK_NOFOLLOW) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -180,17 +180,17 @@ dirfd_copy_attributes_and_xattrs (int src_parent_dfd,
if (fstat (src_dfd, &src_stbuf) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
if (fchown (dest_dfd, src_stbuf.st_uid, src_stbuf.st_gid) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
if (fchmod (dest_dfd, src_stbuf.st_mode) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -218,7 +218,7 @@ copy_dir_recurse_fsync (int src_parent_dfd,
/* Create with mode 0700, we'll fchmod/fchown later */
if (mkdirat (dest_parent_dfd, name, 0700) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -232,7 +232,7 @@ copy_dir_recurse_fsync (int src_parent_dfd,
srcd = fdopendir (src_dfd);
if (!srcd)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -248,7 +248,7 @@ copy_dir_recurse_fsync (int src_parent_dfd,
if (fstatat (src_dfd, name, &child_stbuf,
AT_SYMLINK_NOFOLLOW) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -270,7 +270,7 @@ copy_dir_recurse_fsync (int src_parent_dfd,
/* And finally, fsync the fd */
if (fsync (dest_dfd) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
@@ -337,7 +337,7 @@ ensure_directory_from_template (int orig_etc_fd,
}
else
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
g_prefix_error (error, "mkdirat: ");
goto out;
}
@@ -387,7 +387,7 @@ copy_modified_config_file (int orig_etc_fd,
if (fstatat (modified_etc_fd, path, &modified_stbuf, AT_SYMLINK_NOFOLLOW) < 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
g_prefix_error (error, "Failed to read modified config file '%s': ", path);
goto out;
}
@@ -405,7 +405,7 @@ copy_modified_config_file (int orig_etc_fd,
dest_parent_dfd = dup (new_etc_fd);
if (dest_parent_dfd == -1)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -418,7 +418,7 @@ copy_modified_config_file (int orig_etc_fd,
;
else
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -444,7 +444,7 @@ copy_modified_config_file (int orig_etc_fd,
{
if (unlinkat (new_etc_fd, path, 0) < 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}
}
@@ -472,7 +472,7 @@ copy_modified_config_file (int orig_etc_fd,
if (fsync (dest_parent_dfd) != 0)
{
ot_util_set_error_from_errno (error, errno);
gs_set_error_from_errno (error, errno);
goto out;
}