From: Roger Pau Monne Date: Mon, 23 Jul 2012 12:09:45 +0000 (+0100) Subject: pygrub: don't leave fds open X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~8169 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ed78b8ba6619d054020b2738eabe323ca4a25d68;p=xen.git pygrub: don't leave fds open On NetBSD a block device can only be opened once, so make sure pygrub closes it every time, if this is not done libfsimage is not able to open the disk later. Signed-off-by: Roger Pau Monne Acked-by: Christoph Egger Acked-by: Ian Jackson Committed-by: Ian Campbell --- diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index 6dd44ace6a..ad78c22de0 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -67,6 +67,7 @@ def get_solaris_slice(file, offset): fd = os.open(file, os.O_RDONLY) os.lseek(fd, offset + (DK_LABEL_LOC * SECTOR_SIZE), 0) buf = os.read(fd, 512) + os.close(fd) if struct.unpack("