PR 67585 Handle EINTR
commit714f1fe251ae7e6178c22fb20be292639c77cd19
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Oct 2016 18:05:56 +0000 (9 18:05 +0000)
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Oct 2016 18:05:56 +0000 (9 18:05 +0000)
treec793adb9e84177e3ddeb8a327cecd0543a6f697f
parentef9db9ac3c7e8182fe672b800bb4df8e72d399c0
PR 67585 Handle EINTR

Many POSIX systems have the bad habit of not restarting interrupted
syscalls. On these systems it's up to the user to check for an error
with errno == EINTR and restart manually. This patch does this for
libgfortran, so that GFortran users don't have to do it.

2016-10-09  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/67585
        * io/io.h: TEMP_FAILURE_RETRY: Define macro if not found.
        * io/unix.c (raw_read): Handle EINTR.
        (raw_write): Check for return value -1.
        (raw_seek): Handle EINTR.
        (raw_tell): Likewise.
        (raw_size): Likewise.
        (raw_truncate): Likewise.
        (raw_close): Likewise.
        (buf_flush): Call raw_seek instead of lseek.
        (buf_read): Likewise.
        (buf_write): Likewise.
        (fd_to_stream): Handle EINTR.
        (tempfile_open): Likewise.
        (regular_file2): Likewise.
        (compare_file_filename): Likewise.
        (find_file): Likewise.
        (inquire_sequential): Likewise.
        (inquire_direct): Likewise.
        (inquire_formatted): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240902 138bc75d-0d04-0410-961f-82ee72b054a4
libgfortran/ChangeLog
libgfortran/io/io.h
libgfortran/io/unix.c