[master] Restart waitpid on EINTR

David Shea dshea at redhat.com
Fri Aug 15 19:09:40 UTC 2014


On 08/11/2014 01:31 PM, David Shea wrote:
> Depending on the order or child exits and signals and waitpid starting,
> calling waitpid alone sometimes works and sometimes crashes anaconda.
> Check if an exception indicates that waitpid should restart.
> ---
>   anaconda                             |  8 ++++++--
>   pyanaconda/iutil.py                  | 16 ++++++++++++++++
>   pyanaconda/users.py                  |  2 +-
>   tests/pyanaconda_tests/iutil_test.py | 36 ++++++++++++++++++++++++++++++++++++
>   4 files changed, 59 insertions(+), 3 deletions(-)

Actually, I guess something like this should apply to any os.* call. The 
subprocess module has this function:

def _eintr_retry_call(func, *args):
     while True:
         try:
             return func(*args)
         except (OSError, IOError) as e:
             if e.errno == errno.EINTR:
                 continue
             raise


so we can copy that and use it as a wrapper, instead.



More information about the anaconda-patches mailing list