diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2017-03-23 11:59:22 -0500 |
---|---|---|
committer | Quentin Glidic <sardemff7+git@sardemff7.net> | 2017-03-24 21:00:54 +0100 |
commit | 91d4bce7c33338473f649108e326a6405eeff58b (patch) | |
tree | 2e1dcce905895fe40a9b96f8bf16a863be0e9c52 /shared/os-compatibility.c | |
parent | 7fecb43735b71207210d056874e164e057ce8723 (diff) |
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>
Diffstat (limited to 'shared/os-compatibility.c')
-rw-r--r-- | shared/os-compatibility.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shared/os-compatibility.c b/shared/os-compatibility.c index 551f2a99..6b2f3770 100644 --- a/shared/os-compatibility.c +++ b/shared/os-compatibility.c @@ -178,7 +178,9 @@ os_create_anonymous_file(off_t size) return -1; #ifdef HAVE_POSIX_FALLOCATE - ret = posix_fallocate(fd, 0, size); + do { + ret = posix_fallocate(fd, 0, size); + } while (ret == EINTR); if (ret != 0) { close(fd); errno = ret; |