BmapFlasher: open the block device in write-only mode
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 6 Nov 2012 11:47:46 +0000 (13:47 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 7 Nov 2012 08:50:42 +0000 (10:50 +0200)
... we do not need the read access.

Change-Id: I3cabe1ec9a6966981678f4d460edf848f6b0cd2a
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/BmapFlasher.py

index 8a53c39..fbcf468 100644 (file)
@@ -145,7 +145,7 @@ class BmapFlasher:
         """ Open the block device in excluseve mode. """
 
         try:
-            self._f_bdev = os.open(self._bdev_path, os.O_RDWR | os.O_EXCL)
+            self._f_bdev = os.open(self._bdev_path, os.O_WRONLY | os.O_EXCL)
         except OSError as err:
             raise Error("cannot open block device '%s' in exclusive mode: %s" \
                         % (self._bdev_path, err.strerror))