diff options
author | H. Peter Anvin <hpa@zytor.com> | 2014-01-17 16:54:32 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2014-01-17 16:55:34 -0800 |
commit | 12eae5ce91273ba9a98b7fe9a838f5ef2f9044b7 (patch) | |
tree | 871283162279ea3cff76c9c776ea024c4839c4dd /extlinux | |
parent | 39311d7551b2834c67f3fd3ac197f8f634afb2d1 (diff) | |
download | syslinux-12eae5ce91273ba9a98b7fe9a838f5ef2f9044b7.tar.gz |
installer: Add sparse address space annotations to the syslinux image
Add sparse address space annotations for the syslinux boot image, to
make it easier to catch errors that break the DOS installer build
again. Use "make CC=cgcc" to run sparse.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'extlinux')
-rw-r--r-- | extlinux/main.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/extlinux/main.c b/extlinux/main.c index 9ee9abb4..47c1e68e 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -455,7 +455,7 @@ static int rewrite_boot_image(int devfd, const char *path, const char *filename) } /* Write boot image data into LDLINUX.SYS file */ - ret = xpwrite(fd, boot_image, boot_image_len, 0); + ret = xpwrite(fd, (const char _force *)boot_image, boot_image_len, 0); if (ret != boot_image_len) { perror("writing bootblock"); goto error; @@ -473,7 +473,7 @@ static int rewrite_boot_image(int devfd, const char *path, const char *filename) /* Write the patch area again - this relies on the file being overwritten * in place! */ - ret = xpwrite(fd, boot_image, modbytes, 0); + ret = xpwrite(fd, (const char _force *)boot_image, modbytes, 0); if (ret != modbytes) { fprintf(stderr, "%s: write failure on %s\n", program, filename); goto error; @@ -552,7 +552,8 @@ int ext2_fat_install_file(const char *path, int devfd, struct stat *rst) goto bail; } - r3 = xpwrite(fd, syslinux_ldlinuxc32, syslinux_ldlinuxc32_len, 0); + r3 = xpwrite(fd, (const char _force *)syslinux_ldlinuxc32, + syslinux_ldlinuxc32_len, 0); if (r3 != syslinux_ldlinuxc32_len) { fprintf(stderr, "%s: write failure on %s\n", program, c32file); goto bail; @@ -584,7 +585,8 @@ int btrfs_install_file(const char *path, int devfd, struct stat *rst) int fd, rv; patch_file_and_bootblock(-1, path, devfd); - if (xpwrite(devfd, boot_image, boot_image_len, BTRFS_EXTLINUX_OFFSET) + if (xpwrite(devfd, (const char _force *)boot_image, + boot_image_len, BTRFS_EXTLINUX_OFFSET) != boot_image_len) { perror("writing bootblock"); return 1; @@ -621,7 +623,8 @@ int btrfs_install_file(const char *path, int devfd, struct stat *rst) return 1; } - rv = xpwrite(fd, syslinux_ldlinuxc32, syslinux_ldlinuxc32_len, 0); + rv = xpwrite(fd, (const char _force *)syslinux_ldlinuxc32, + syslinux_ldlinuxc32_len, 0); if (rv != (int)syslinux_ldlinuxc32_len) { fprintf(stderr, "%s: write failure on %s\n", program, file); rv = 1; @@ -699,7 +702,8 @@ static int xfs_install_file(const char *path, int devfd, struct stat *rst) goto bail; } - retval = xpwrite(fd, syslinux_ldlinuxc32, syslinux_ldlinuxc32_len, 0); + retval = xpwrite(fd, (const char _force *)syslinux_ldlinuxc32, + syslinux_ldlinuxc32_len, 0); if (retval != (int)syslinux_ldlinuxc32_len) { fprintf(stderr, "%s: write failure on %s\n", program, file); goto bail; |