diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-03-04 16:37:49 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-03-04 16:37:49 -0800 |
commit | 8acec63e1d96a578f8fc978cfb4ae58f7c482593 (patch) | |
tree | d9f91cb98d3e0d9dfb2973de4076580e77b497eb /extlinux | |
parent | 11aab30bfa37846d44f501ab94a86cf9a7387d61 (diff) | |
download | syslinux-8acec63e1d96a578f8fc978cfb4ae58f7c482593.tar.gz |
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@zytor.com>
Diffstat (limited to 'extlinux')
-rw-r--r-- | extlinux/main.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/extlinux/main.c b/extlinux/main.c index aed265fe..c6ac87d0 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; |