mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-07-21 10:44:25 +00:00
os: Check for EINTR on posix_fallocate()
posix_fallocate() can return EINTR and need to be restarted - I've hit this when running weston-terminal under gdb. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
7fecb43735
commit
91d4bce7c3
|
@ -178,7 +178,9 @@ os_create_anonymous_file(off_t size)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef HAVE_POSIX_FALLOCATE
|
#ifdef HAVE_POSIX_FALLOCATE
|
||||||
ret = posix_fallocate(fd, 0, size);
|
do {
|
||||||
|
ret = posix_fallocate(fd, 0, size);
|
||||||
|
} while (ret == EINTR);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
close(fd);
|
close(fd);
|
||||||
errno = ret;
|
errno = ret;
|
||||||
|
|
Loading…
Reference in a new issue