[Fedora-livecd-list] imgcreate/fs.py
Bruno Wolff III
bruno at fedoraproject.org
Sat Sep 11 18:37:48 UTC 2010
imgcreate/fs.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit a5c394bb526de9090bb82c2703e29785ec3f254f
Author: Bruno Wolff III <bruno at wolff.to>
Date: Sat Sep 11 13:32:53 2010 -0500
Don't create sparse files one byte too large.
Bug 579769.
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index c8df085..9f9d8ea 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -310,7 +310,9 @@ class SparseLoopbackDisk(LoopbackDisk):
logging.debug("Extending sparse file %s to %d" % (self.lofile, size))
fd = os.open(self.lofile, flags)
- os.lseek(fd, size, 0)
+ if size <= 0:
+ size = 1
+ os.lseek(fd, size-1, 0)
os.write(fd, '\x00')
os.close(fd)
More information about the livecd
mailing list