mirror of
https://github.com/partic2/libffi
synced 2026-11-11 10:37:19 +00:00
handle compilation warnings with ftruncate API (#508)
* fix me: avoid warning while handle ftruncate API Signed-off-by: Prasad Nallani <prasad.nallani@intel.com> * Update closures.c
This commit is contained in:
+13
-2
@@ -789,7 +789,13 @@ dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset)
|
|||||||
close (execfd);
|
close (execfd);
|
||||||
goto retry_open;
|
goto retry_open;
|
||||||
}
|
}
|
||||||
ftruncate (execfd, offset);
|
if (ftruncate (execfd, offset) != 0)
|
||||||
|
{
|
||||||
|
/* Fixme : Error logs can be added here. Returning an error for
|
||||||
|
* ftruncte() will not add any advantage as it is being
|
||||||
|
* validating in the error case. */
|
||||||
|
}
|
||||||
|
|
||||||
return MFAIL;
|
return MFAIL;
|
||||||
}
|
}
|
||||||
else if (!offset
|
else if (!offset
|
||||||
@@ -801,7 +807,12 @@ dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset)
|
|||||||
if (start == MFAIL)
|
if (start == MFAIL)
|
||||||
{
|
{
|
||||||
munmap (ptr, length);
|
munmap (ptr, length);
|
||||||
ftruncate (execfd, offset);
|
if (ftruncate (execfd, offset) != 0)
|
||||||
|
{
|
||||||
|
/* Fixme : Error logs can be added here. Returning an error for
|
||||||
|
* ftruncte() will not add any advantage as it is being
|
||||||
|
* validating in the error case. */
|
||||||
|
}
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user