extlinux: don't report failure after writing a FAT superblock
authorH. Peter Anvin <hpa@zytor.com>
Fri, 5 Mar 2010 00:37:49 +0000 (16:37 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 5 Mar 2010 00:37:49 +0000 (16:37 -0800)
Missing parens made us return failure after successfully writing a FAT
superblock.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
extlinux/main.c

index aed265f..c6ac87d 100644 (file)
@@ -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;