mirror of
https://github.com/ostreedev/ostree.git
synced 2025-02-06 01:57:58 +03:00
Merge pull request #2871 from dustymabe/dusty-fallocate-einval
lib/deploy: skip fallocate call when requested size is 0
This commit is contained in:
commit
67929db1dc
@ -2446,6 +2446,14 @@ get_kernel_layout_size (OstreeSysroot *self, OstreeDeployment *deployment, guint
|
|||||||
static gboolean
|
static gboolean
|
||||||
dfd_fallocate_check (int dfd, __off_t len, gboolean *out_passed, GError **error)
|
dfd_fallocate_check (int dfd, __off_t len, gboolean *out_passed, GError **error)
|
||||||
{
|
{
|
||||||
|
/* If the requested size is 0 then return early. Passing a 0 len to
|
||||||
|
* fallocate results in EINVAL */
|
||||||
|
if (len == 0)
|
||||||
|
{
|
||||||
|
*out_passed = TRUE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
g_auto (GLnxTmpfile) tmpf = {
|
g_auto (GLnxTmpfile) tmpf = {
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user