From 1413b01974f156dc51c45a72256dc609cf4163f3 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 29 Nov 2005 23:12:22 +0000 Subject: [PATCH] catch errors when unmounting --- data/skin.xml | 20 ++++++++++---------- lib/python/Components/Harddisk.py | 6 ++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/data/skin.xml b/data/skin.xml index a5e8c6d5..af388807 100644 --- a/data/skin.xml +++ b/data/skin.xml @@ -170,17 +170,17 @@ - + + + diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 0fc17d69..09864fc9 100644 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -103,7 +103,8 @@ class Harddisk: def unmount(self): cmd = "/bin/umount " + self.devidex + "part*" - os.system(cmd) + res = os.system(cmd) + return (res >> 8) def createPartition(self): cmd = "/sbin/sfdisk -f " + self.devidex + "disc" @@ -127,7 +128,8 @@ class Harddisk: return (res >> 8) def initialize(self): - self.unmount() + if self.unmount() != 0: + return -5 if self.createPartition() != 0: return -1 -- 2.30.2