Well, it was a 50-50 chance to hit the portable write function... Should fix

the anyboot build tool build on non-Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35673 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2010-02-28 20:19:44 +00:00
parent b8e81e7440
commit 596ba08220
+4 -4
View File
@@ -18,7 +18,7 @@ copyLoop(int from, int to, off_t position)
if (copyLength <= 0) if (copyLength <= 0)
return copyLength; return copyLength;
ssize_t written = write_pos(to, position, sCopyBuffer, copyLength); ssize_t written = pwrite(to, sCopyBuffer, copyLength, position);
if (written != copyLength) { if (written != copyLength) {
if (written < 0) if (written < 0)
return written; return written;
@@ -110,12 +110,12 @@ main(int argc, char *argv[])
uint32_t partitionOffset = (uint32_t)(imageOffset / kBlockSize); uint32_t partitionOffset = (uint32_t)(imageOffset / kBlockSize);
((uint32_t *)partition)[2] = partitionOffset; ((uint32_t *)partition)[2] = partitionOffset;
((uint32_t *)partition)[3] = (uint32_t)(imageSize / kBlockSize); ((uint32_t *)partition)[3] = (uint32_t)(imageSize / kBlockSize);
ssize_t written = write_pos(outputFile, 512 - 2 - 16 * 4, partition, 16); ssize_t written = pwrite(outputFile, partition, 16, 512 - 2 - 16 * 4);
checkError(written != 16, "failed to write partition entry"); checkError(written != 16, "failed to write partition entry");
// and make the image bootable // and make the image bootable
written = write_pos(outputFile, imageOffset + 512 - 2 - 4, written = pwrite(outputFile, &partitionOffset, 4,
&partitionOffset, 4); imageOffset + 512 - 2 - 4);
checkError(written != 4, "failed to make image bootable"); checkError(written != 4, "failed to make image bootable");
free(sCopyBuffer); free(sCopyBuffer);