/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2012-06-23 13:50:05 UTC
  • Revision ID: teddy@recompile.se-20120623135005-t0wtkmlw0ymnr2kg
* mandos (Client.start_checker): Return True (retry later) if starting
                                 checker failed.  Check for ECHILD
                                 from waitpid().

Show diffs side-by-side

added added

removed removed

Lines of Context:
717
717
            except OSError as error:
718
718
                logger.error("Failed to start subprocess",
719
719
                             exc_info=error)
 
720
                return True
720
721
            self.checker_callback_tag = (gobject.child_watch_add
721
722
                                         (self.checker.pid,
722
723
                                          self.checker_callback,
723
724
                                          data=command))
724
725
            # The checker may have completed before the gobject
725
726
            # watch was added.  Check for this.
726
 
            pid, status = os.waitpid(self.checker.pid, os.WNOHANG)
 
727
            try:
 
728
                pid, status = os.waitpid(self.checker.pid, os.WNOHANG)
 
729
            except OSError as error:
 
730
                if error.errno == errno.ECHILD:
 
731
                    logger.error("Child process vanished", exc_info=error)
 
732
                    return True
 
733
                raise
727
734
            if pid:
728
735
                gobject.source_remove(self.checker_callback_tag)
729
736
                self.checker_callback(pid, status, command)