tree-wide: Some glnx_fstatat_allow_noent() porting
The new API is definitely nicer. Closes: #1180 Approved by: jlebon
This commit is contained in:
1 parent
c62b36046b
commit
13c3898cc2
7 files changed
+55
-100
No files matched your search
@@ -541,12 +541,9 @@ parse_origin (OstreeSysroot *self,
|
||||
g_autoptr(GKeyFile) ret_origin = g_key_file_new ();
|
||||
|
||||
struct stat stbuf;
|
||||
if (fstatat (deployment_dfd, origin_path, &stbuf, 0) != 0)
|
||||
{
|
||||
if (errno != ENOENT)
|
||||
return glnx_throw_errno (error);
|
||||
}
|
||||
else
|
||||
if (!glnx_fstatat_allow_noent (deployment_dfd, origin_path, &stbuf, 0, error))
|
||||
return FALSE;
|
||||
if (errno == 0)
|
||||
{
|
||||
g_autofree char *origin_contents =
|
||||
glnx_file_get_contents_utf8_at (deployment_dfd, origin_path,
|
||||
@@ -808,8 +805,8 @@ ostree_sysroot_load_if_changed (OstreeSysroot *self,
|
||||
return FALSE;
|
||||
|
||||
struct stat stbuf;
|
||||
if (fstatat (self->sysroot_fd, "ostree/deploy", &stbuf, 0) < 0)
|
||||
return glnx_throw_errno_prefix (error, "fstatat");
|
||||
if (!glnx_fstatat (self->sysroot_fd, "ostree/deploy", &stbuf, 0, error))
|
||||
return FALSE;
|
||||
|
||||
if (out_changed)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user