summaryrefslogtreecommitdiff
path: root/mbr.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2010-01-05 00:14:19 -0500
committersrs5694 <srs5694@users.sourceforge.net>2010-01-05 00:14:19 -0500
commit1e09372bca227ffbfb9dda48160826d8f63ce9bb (patch)
treefc7985fba7adc24d200c15355126e422ecea912b /mbr.cc
parent5d58fe0ea12c9c727c8a970c8e1ac08ea7fbe05f (diff)
downloadsgdisk-1e09372bca227ffbfb9dda48160826d8f63ce9bb.tar.gz
Early support for larger-than-512-byte sectors and even earlier support
for sgdisk program. (The latter is just proof-of-concept at this point; it doesn't do anything useful.)
Diffstat (limited to 'mbr.cc')
-rw-r--r--mbr.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/mbr.cc b/mbr.cc
index e06d821..efd6fd3 100644
--- a/mbr.cc
+++ b/mbr.cc
@@ -98,7 +98,7 @@ void MBRData::ReadMBRData(int fd, int checkBlockSize) {
EmptyMBR(0);
err = lseek64(fd, 0, SEEK_SET);
- err = read(fd, &tempMBR, 512);
+ err = myRead(fd, (char*) &tempMBR, 512);
for (i = 0; i < 440; i++)
code[i] = tempMBR.code[i];
diskSignature = tempMBR.diskSignature;
@@ -202,7 +202,7 @@ int MBRData::ReadLogicalPart(int fd, uint32_t extendedStart,
fprintf(stderr, "Unable to seek to %lu! Aborting!\n", (unsigned long) offset);
partNum = -1;
}
- if (read(fd, &ebr, 512) != 512) { // Load the data....
+ if (myRead(fd, (char*) &ebr, 512) != 512) { // Load the data....
fprintf(stderr, "Error seeking to or reading logical partition data from %lu!\nAborting!\n",
(unsigned long) offset);
partNum = -1;
@@ -289,7 +289,7 @@ void MBRData::WriteMBRData(int fd) {
// Now write that data structure...
lseek64(fd, 0, SEEK_SET);
- if (write(fd, &tempMBR, 512) != 512) {
+ if (myWrite(fd, (char*) &tempMBR, 512) != 512) {
fprintf(stderr, "Warning! Error %d when saving MBR!\n", errno);
} // if