summaryrefslogtreecommitdiff
path: root/diskio.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2010-03-19 14:21:59 -0400
committersrs5694 <srs5694@users.sourceforge.net>2010-03-19 14:21:59 -0400
commita8582cfe6c1aa5e5f80458ac72d881a04ae0ba44 (patch)
tree93cbbc9e8013e2404ab2fe7740eccdf28dc966cf /diskio.cc
parent55d926192adc984462509b2966e23bc0d1129bbd (diff)
downloadsgdisk-a8582cfe6c1aa5e5f80458ac72d881a04ae0ba44.tar.gz
Changes to sector alignment policies and behavior when restoring a
backup fails
Diffstat (limited to 'diskio.cc')
-rw-r--r--diskio.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/diskio.cc b/diskio.cc
index a276b5d..d9004f7 100644
--- a/diskio.cc
+++ b/diskio.cc
@@ -34,6 +34,7 @@
#include "support.h"
#include "diskio.h"
+#include "gpt.h"
using namespace std;
@@ -93,11 +94,12 @@ int DiskIO::OpenForWrite(const string & filename) {
// returns 1-sector alignment for unusual sector sizes and drives smaller than
// a size defined by SMALLEST_ADVANCED_FORMAT, and 8-sector alignment for
// larger drives with 512-byte sectors.
-int DiskIO::FindAlignment(void) {
- int err, result;
+uint32_t DiskIO::FindAlignment(void) {
+ int err;
+ uint32_t result;
if ((GetBlockSize() == 512) && (DiskSize(&err) >= SMALLEST_ADVANCED_FORMAT)) {
- result = 8; // play it safe; align for 4096-byte sectors
+ result = DEFAULT_ALIGNMENT; // play it safe; align for 4096-byte sectors
} else {
result = 1; // unusual sector size; assume it's the real physical size
} // if/else