[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Pygrub: stop the FS identification code from leaking open fds.
# HG changeset patch # User Tim Deegan <tim.deegan@xxxxxxxxxxxxx> # Node ID 587735fb18abf1dd1b7dcb621810e3eaf129b1d7 # Parent 93135bbb5344fda74ab5596a84e4a5c9715ae674 Pygrub: stop the FS identification code from leaking open fds. Signed-off-by: Tim Deegan <tim.deegn@xxxxxxxxxxxxx> --- tools/pygrub/src/fsys/ext2/__init__.py | 2 +- tools/pygrub/src/fsys/reiser/__init__.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff -r 93135bbb5344 -r 587735fb18ab tools/pygrub/src/fsys/ext2/__init__.py --- a/tools/pygrub/src/fsys/ext2/__init__.py Thu Sep 21 11:33:38 2006 +0100 +++ b/tools/pygrub/src/fsys/ext2/__init__.py Thu Sep 21 14:55:02 2006 +0100 @@ -23,7 +23,7 @@ class Ext2FileSystemType(FileSystemType) fd = os.open(fn, os.O_RDONLY) os.lseek(fd, offset, 0) buf = os.read(fd, 2048) - + os.close(fd) if len(buf) > 1082 and \ struct.unpack("<H", buf[1080:1082]) == (0xef53,): return True diff -r 93135bbb5344 -r 587735fb18ab tools/pygrub/src/fsys/reiser/__init__.py --- a/tools/pygrub/src/fsys/reiser/__init__.py Thu Sep 21 11:33:38 2006 +0100 +++ b/tools/pygrub/src/fsys/reiser/__init__.py Thu Sep 21 14:55:02 2006 +0100 @@ -26,6 +26,7 @@ class ReiserFileSystemType(FileSystemTyp fd = os.open(fn, os.O_RDONLY) os.lseek(fd, 0x10000, 0) buf = os.read(fd, 0x40) + os.close(fd) if len(buf) == 0x40 and (buf[0x34:0x3B] in [FSMAGIC2, FSMAGIC3]) : return True return False _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |