Skip to content
Snippets Groups Projects
Commit 547bcea2 authored by Colin Walters's avatar Colin Walters
Browse files

fdio: Add a fchmod wrapper

There are a number of versions of this in ostree at least, might as well wrap
it.
parent 8b75c8e3
No related branches found
No related tags found
No related merge requests found
......@@ -241,6 +241,28 @@ glnx_fstat (int fd,
return TRUE;
}
/**
* glnx_fchmod:
* @fd: FD
* @mode: Mode
* @error: Return location for a #GError, or %NULL
*
* Wrapper around fchmod() which adds #GError support and ensures that it
* retries on %EINTR.
*
* Returns: %TRUE on success, %FALSE otherwise
* Since: UNRELEASED
*/
static inline gboolean
glnx_fchmod (int fd,
mode_t mode,
GError **error)
{
if (TEMP_FAILURE_RETRY (fchmod (fd, mode)) != 0)
return glnx_throw_errno_prefix (error, "fchmod");
return TRUE;
}
/**
* glnx_fstatat:
* @dfd: Directory FD to stat beneath
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment