os: Check for EINTR on ftruncate()
The man page indicates that ftruncate() can set errno to EINTR, so test for this. I have not actually been able to provoke an EINTR error from ftruncate() in testing though. 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
91d4bce7c3
commit
5ef6bd7eee
|
@ -187,7 +187,9 @@ os_create_anonymous_file(off_t size)
|
|||
return -1;
|
||||
}
|
||||
#else
|
||||
ret = ftruncate(fd, size);
|
||||
do {
|
||||
ret = ftruncate(fd, size);
|
||||
} while (ret < 0 && errno == EINTR);
|
||||
if (ret < 0) {
|
||||
close(fd);
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue