]> git.sur5r.net Git - u-boot/blobdiff - test/py/u_boot_spawn.py
ARM: at91: sama5d2: configure the L2 cache memory
[u-boot] / test / py / u_boot_spawn.py
index 4b9e81af3efbdd8e2d96db58273f194906ef91e6..a5f4a8e91baed1aa8c9f3dce7c0072fc28ca13da 100644 (file)
@@ -56,8 +56,12 @@ class Spawn(object):
             finally:
                 os._exit(255)
 
-        self.poll = select.poll()
-        self.poll.register(self.fd, select.POLLIN | select.POLLPRI | select.POLLERR | select.POLLHUP | select.POLLNVAL)
+        try:
+            self.poll = select.poll()
+            self.poll.register(self.fd, select.POLLIN | select.POLLPRI | select.POLLERR | select.POLLHUP | select.POLLNVAL)
+        except:
+            self.close()
+            raise
 
     def kill(self, sig):
         """Send unix signal "sig" to the child process.
@@ -142,7 +146,7 @@ class Spawn(object):
                     earliest_pi = pi
                 if earliest_m:
                     pos = earliest_m.start()
-                    posafter = earliest_m.end() + 1
+                    posafter = earliest_m.end()
                     self.before = self.buf[:pos]
                     self.after = self.buf[pos:posafter]
                     self.buf = self.buf[posafter:]