[syslinux:pathbased] extlinux: don't report failure after writing a FAT superblock
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Thu Mar 4 16:57:03 PST 2010
Commit-ID: 8acec63e1d96a578f8fc978cfb4ae58f7c482593
Gitweb: http://syslinux.zytor.com/commit/8acec63e1d96a578f8fc978cfb4ae58f7c482593
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Thu, 4 Mar 2010 16:37:49 -0800
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Thu, 4 Mar 2010 16:37:49 -0800
extlinux: don't report failure after writing a FAT superblock
Missing parens made us return failure after successfully writing a FAT
superblock.
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
extlinux/main.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/extlinux/main.c b/extlinux/main.c
index aed265f..c6ac87d 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -734,12 +734,15 @@ int install_bootblock(int fd, const char *device)
struct boot_sector *bs = (struct boot_sector *)extlinux_bootsect;
if (xpwrite(fd, &bs->bsHead, bsHeadLen, 0) != bsHeadLen ||
xpwrite(fd, &bs->bsCode, bsCodeLen,
- offsetof(struct boot_sector, bsCode)) != bsCodeLen)
- perror("writing fat bootblock");
- return 1;
- } else if (xpwrite(fd, boot_block, boot_block_len, 0) != boot_block_len) {
- perror("writing bootblock");
- return 1;
+ offsetof(struct boot_sector, bsCode)) != bsCodeLen) {
+ perror("writing fat bootblock");
+ return 1;
+ }
+ } else {
+ if (xpwrite(fd, boot_block, boot_block_len, 0) != boot_block_len) {
+ perror("writing bootblock");
+ return 1;
+ }
}
return 0;
More information about the Syslinux-commits
mailing list