From ed78b8ba6619d054020b2738eabe323ca4a25d68 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Mon, 23 Jul 2012 13:09:45 +0100 Subject: [PATCH] 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 --- tools/pygrub/src/pygrub | 3 +++ 1 file changed, 3 insertions(+) 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("