[master] Restart waitpid on EINTR
Vratislav Podzimek
vpodzime at redhat.com
Mon Aug 25 08:17:05 UTC 2014
On Fri, 2014-08-15 at 15:09 -0400, David Shea wrote:
> 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.
Seems like a good idea to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list