diff options
Diffstat (limited to 'contrib/syslinux/syslinux-4.03/com32/gpllib/disk/bootloaders.c')
-rw-r--r-- | contrib/syslinux/syslinux-4.03/com32/gpllib/disk/bootloaders.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/contrib/syslinux/syslinux-4.03/com32/gpllib/disk/bootloaders.c b/contrib/syslinux/syslinux-4.03/com32/gpllib/disk/bootloaders.c deleted file mode 100644 index e034011..0000000 --- a/contrib/syslinux/syslinux-4.03/com32/gpllib/disk/bootloaders.c +++ /dev/null @@ -1,46 +0,0 @@ -/* ----------------------------------------------------------------------- * - * - * Copyright 2009 Pierre-Alexandre Meyer - * - * This file is part of Syslinux, and is made available under - * the terms of the GNU General Public License version 2. - * - * ----------------------------------------------------------------------- */ - -#include <disk/bootloaders.h> -#include <disk/common.h> -#include <disk/geom.h> -#include <disk/read.h> -#include <stdlib.h> -#include <string.h> - -/** - * get_bootloader_string - return a string describing the boot code in a - * bootsector - * @d: driveinfo struct describing the drive - * @p: partition to scan (usually the active one) - * @buffer: pre-allocated buffer - * @buffer_size: @buffer size - **/ -int get_bootloader_string(struct driveinfo *d, const struct part_entry *p, - char *buffer, const int buffer_size) -{ - char boot_sector[SECTOR * sizeof(char)]; - - if (read_sectors(d, &boot_sector, p->start_lba, 1) == -1) - return -1; - else { - if (!strncmp(boot_sector + 3, "SYSLINUX", 8)) - strlcpy(buffer, "SYSLINUX", buffer_size - 1); - else if (!strncmp(boot_sector + 3, "EXTLINUX", 8)) - strlcpy(buffer, "EXTLINUX", buffer_size - 1); - else if (!strncmp(boot_sector + 3, "MSWIN4.1", 8)) - strlcpy(buffer, "MSWIN4.1", buffer_size - 1); - else - return -1; - /* Add more... */ - - buffer[buffer_size - 1] = '\0'; - return 0; - } -} |