fix shadowed variable bugs and undefined cpp macro bugs.
This commit is contained in:
parent
ca924e1180
commit
952982deb9
16 changed files with 1192 additions and 1334 deletions
36
ChangeLog
36
ChangeLog
|
@ -1,3 +1,39 @@
|
||||||
|
2000-07-29 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
|
* configure.in (CPPFLAGS): Added -Wshadow, -Wpointer-arith and
|
||||||
|
-Wundef, as GCC sometimes more clever than me. :)
|
||||||
|
* stage2/shared.h [!ASM_FILE] (multi_boot): Change the name of
|
||||||
|
the second argument from "mbi" to "mb_info".
|
||||||
|
[!ASM_FILE] (biosdisk): Rename the first argument "read" to
|
||||||
|
"subfunc".
|
||||||
|
* lib/device.h (init_device_map): Change the name of the third
|
||||||
|
argument from "floppy_disks" to "no_floppies".
|
||||||
|
* lib/device.c (read_device_map): Rename the internal function
|
||||||
|
"print_error" to "show_error".
|
||||||
|
* stage2/builtins.c (install_func): Rename CONFIG_FILE to
|
||||||
|
REAL_CONFIG.
|
||||||
|
(setup_func): Rename INSTALL_DRIVE, INSTALL_PARTITION and
|
||||||
|
CONFIG_FILE to INSTALLED_DRIVE, INSTALLED_PARTITION and
|
||||||
|
CONFIG_FILENAME, respectively.
|
||||||
|
* stage2/char_io.c (convert_to_ascii): Rename the internal
|
||||||
|
variable C to TMP.
|
||||||
|
(get_cmdline): Rename KILL to KILL_BUF.
|
||||||
|
Rename the second argument for cl_print to REAL_ECHO_CHAR from
|
||||||
|
ECHO_CHAR.
|
||||||
|
* stage2/stage2.c (run_menu): Rename the internal variable
|
||||||
|
NUM_ENTRIES to NEW_NUM_ENTRIES.
|
||||||
|
(cmain): Rename KILL to KILL_BUF.
|
||||||
|
* stage2/disk_inode_ffs.h: Check if BYTE_MSF is defined before
|
||||||
|
checking the value.
|
||||||
|
* stage2/fsys_ext2fs.c (ext2fs_dir): Check if E2DEBUG is
|
||||||
|
defined, instead of if the value is non-zero.
|
||||||
|
* grub/asmstub.c: Check if __GLIBC__ is defined before checking
|
||||||
|
the value.
|
||||||
|
(biosdisk) [__linux__]: Likewise.
|
||||||
|
Rename the first argument for _llseek to "seeked_fd" from "fd".
|
||||||
|
(multi_boot): Rename the second argument to "mb_info" from
|
||||||
|
"mbi".
|
||||||
|
|
||||||
2000-07-27 Gordon Matzigkeit <gord@fig.org>
|
2000-07-27 Gordon Matzigkeit <gord@fig.org>
|
||||||
|
|
||||||
* util/grub-image.in: Initial cut at a script for creating GRUB
|
* util/grub-image.in: Initial cut at a script for creating GRUB
|
||||||
|
|
44
config.h.in
44
config.h.in
|
@ -27,44 +27,36 @@
|
||||||
/* Defined if an absolute indirect call/jump must NOT be prefixed with `*'. */
|
/* Defined if an absolute indirect call/jump must NOT be prefixed with `*'. */
|
||||||
#undef ABSOLUTE_WITHOUT_ASTERISK
|
#undef ABSOLUTE_WITHOUT_ASTERISK
|
||||||
|
|
||||||
/* Define it to "addr32" or "addr32;" to make GAS happy */
|
|
||||||
#undef ADDR32
|
|
||||||
|
|
||||||
/* Define it to "data32" or "data32;" to make GAS happy */
|
|
||||||
#undef DATA32
|
|
||||||
|
|
||||||
/* Define if C symbols get an underscore after compilation */
|
|
||||||
#undef HAVE_ASM_USCORE
|
|
||||||
|
|
||||||
/* Define if you have the <curses.h> header file. */
|
/* Define if you have the <curses.h> header file. */
|
||||||
#undef HAVE_CURSES_H
|
#undef HAVE_CURSES_H
|
||||||
|
|
||||||
/* Define if you have the `curses' library (-lcurses). */
|
|
||||||
#undef HAVE_LIBCURSES
|
|
||||||
|
|
||||||
/* Define if you have the `ncurses' library (-lncurses). */
|
|
||||||
#undef HAVE_LIBNCURSES
|
|
||||||
|
|
||||||
/* Define if you have the `util' library (-lutil). */
|
|
||||||
#undef HAVE_LIBUTIL
|
|
||||||
|
|
||||||
/* Define if you have the <ncurses/curses.h> header file. */
|
|
||||||
#undef HAVE_NCURSES_CURSES_H
|
|
||||||
|
|
||||||
/* Define if you have the <ncurses.h> header file. */
|
/* Define if you have the <ncurses.h> header file. */
|
||||||
#undef HAVE_NCURSES_H
|
#undef HAVE_NCURSES_H
|
||||||
|
|
||||||
/* Define if opendisk() in -lutil can be used */
|
/* Define if you have the <ncurses/curses.h> header file. */
|
||||||
#undef HAVE_OPENDISK
|
#undef HAVE_NCURSES_CURSES_H
|
||||||
|
|
||||||
/* Define if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
/* Define if you have the <string.h> header file. */
|
||||||
#undef HAVE_STRING_H
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have the <strings.h> header file. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
/* Name of package */
|
/* Name of package */
|
||||||
#undef PACKAGE
|
#undef PACKAGE
|
||||||
|
|
||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#undef VERSION
|
#undef VERSION
|
||||||
|
|
||||||
|
/* Define if C symbols get an underscore after compilation */
|
||||||
|
#undef HAVE_ASM_USCORE
|
||||||
|
|
||||||
|
/* Define it to "addr32" or "addr32;" to make GAS happy */
|
||||||
|
#undef ADDR32
|
||||||
|
|
||||||
|
/* Define it to "data32" or "data32;" to make GAS happy */
|
||||||
|
#undef DATA32
|
||||||
|
|
||||||
|
/* Define if opendisk() in -lutil can be used */
|
||||||
|
#undef HAVE_OPENDISK
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,8 @@ AC_SUBST(STAGE2_CFLAGS)
|
||||||
AC_SUBST(GRUB_CFLAGS)
|
AC_SUBST(GRUB_CFLAGS)
|
||||||
|
|
||||||
# Enforce coding standards.
|
# Enforce coding standards.
|
||||||
CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused"
|
CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow"
|
||||||
|
CPPFLAGS="$CPPFLAGS -Wpointer-arith -Wundef"
|
||||||
|
|
||||||
if test "x$with_binutils" != x; then
|
if test "x$with_binutils" != x; then
|
||||||
dnl AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
|
dnl AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
|
||||||
|
|
|
@ -42,7 +42,8 @@ int grub_stage2 (void);
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
# include <sys/ioctl.h> /* ioctl */
|
# include <sys/ioctl.h> /* ioctl */
|
||||||
# if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))
|
# if !defined(__GLIBC__) || \
|
||||||
|
((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
|
||||||
/* Maybe libc doesn't have large file support. */
|
/* Maybe libc doesn't have large file support. */
|
||||||
# include <linux/unistd.h> /* _llseek */
|
# include <linux/unistd.h> /* _llseek */
|
||||||
# include <linux/fs.h> /* BLKFLSBUF */
|
# include <linux/fs.h> /* BLKFLSBUF */
|
||||||
|
@ -274,7 +275,7 @@ big_linux_boot (void)
|
||||||
|
|
||||||
/* booting a multiboot executable */
|
/* booting a multiboot executable */
|
||||||
void
|
void
|
||||||
multi_boot (int start, int mbi)
|
multi_boot (int start, int mb_info)
|
||||||
{
|
{
|
||||||
stop ();
|
stop ();
|
||||||
}
|
}
|
||||||
|
@ -742,13 +743,14 @@ biosdisk (int subfunc, int drive, struct geometry *geometry,
|
||||||
return BIOSDISK_ERROR_GEOMETRY;
|
return BIOSDISK_ERROR_GEOMETRY;
|
||||||
|
|
||||||
/* Seek to the specified location. */
|
/* Seek to the specified location. */
|
||||||
#if defined(__linux__) \
|
#if defined(__linux__) && (!defined(__GLIBC__) || \
|
||||||
&& ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
|
((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
|
||||||
/* Maybe libc doesn't have large file support. */
|
/* Maybe libc doesn't have large file support. */
|
||||||
{
|
{
|
||||||
loff_t offset, result;
|
loff_t offset, result;
|
||||||
static int _llseek (uint fd, ulong hi, ulong lo, loff_t *res, uint wh);
|
static int _llseek (uint seeked_fd, ulong hi, ulong lo,
|
||||||
_syscall5 (int, _llseek, uint, fd, ulong, hi, ulong, lo,
|
loff_t *res, uint wh);
|
||||||
|
_syscall5 (int, _llseek, uint, seeked_fd, ulong, hi, ulong, lo,
|
||||||
loff_t *, res, uint, wh);
|
loff_t *, res, uint, wh);
|
||||||
|
|
||||||
offset = (loff_t) sector * (loff_t) SECTOR_SIZE;
|
offset = (loff_t) sector * (loff_t) SECTOR_SIZE;
|
||||||
|
|
12
lib/device.c
12
lib/device.c
|
@ -300,7 +300,7 @@ check_device (const char *device)
|
||||||
static int
|
static int
|
||||||
read_device_map (FILE *fp, char **map, const char *map_file)
|
read_device_map (FILE *fp, char **map, const char *map_file)
|
||||||
{
|
{
|
||||||
static void print_error (int no, const char *msg)
|
static void show_error (int no, const char *msg)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
|
fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
|
||||||
}
|
}
|
||||||
|
@ -330,14 +330,14 @@ read_device_map (FILE *fp, char **map, const char *map_file)
|
||||||
|
|
||||||
if (*ptr != '(')
|
if (*ptr != '(')
|
||||||
{
|
{
|
||||||
print_error (line_number, "No open parenthesis found");
|
show_error (line_number, "No open parenthesis found");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr++;
|
ptr++;
|
||||||
if ((*ptr != 'f' && *ptr != 'h') || *(ptr + 1) != 'd')
|
if ((*ptr != 'f' && *ptr != 'h') || *(ptr + 1) != 'd')
|
||||||
{
|
{
|
||||||
print_error (line_number, "Bad drive name");
|
show_error (line_number, "Bad drive name");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ read_device_map (FILE *fp, char **map, const char *map_file)
|
||||||
drive = strtoul (ptr, &ptr, 10);
|
drive = strtoul (ptr, &ptr, 10);
|
||||||
if (drive < 0 || drive > 8)
|
if (drive < 0 || drive > 8)
|
||||||
{
|
{
|
||||||
print_error (line_number, "Bad device number");
|
show_error (line_number, "Bad device number");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ read_device_map (FILE *fp, char **map, const char *map_file)
|
||||||
|
|
||||||
if (*ptr != ')')
|
if (*ptr != ')')
|
||||||
{
|
{
|
||||||
print_error (line_number, "No close parenthesis found");
|
show_error (line_number, "No close parenthesis found");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ read_device_map (FILE *fp, char **map, const char *map_file)
|
||||||
|
|
||||||
if (! *ptr)
|
if (! *ptr)
|
||||||
{
|
{
|
||||||
print_error (line_number, "No filename found");
|
show_error (line_number, "No filename found");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
extern void get_drive_geometry (struct geometry *geom, char **map, int drive);
|
extern void get_drive_geometry (struct geometry *geom, char **map, int drive);
|
||||||
extern int check_device (const char *device);
|
extern int check_device (const char *device);
|
||||||
extern int init_device_map (char ***map, const char *map_file,
|
extern int init_device_map (char ***map, const char *map_file,
|
||||||
int floppy_disks);
|
int no_floppies);
|
||||||
extern void restore_device_map (char **map);
|
extern void restore_device_map (char **map);
|
||||||
|
|
||||||
#endif /* DEVICE_MAP_HEADER */
|
#endif /* DEVICE_MAP_HEADER */
|
||||||
|
|
|
@ -1735,7 +1735,7 @@ ENTRY(big_linux_boot)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* multi_boot(int start, int mbi)
|
* multi_boot(int start, int mb_info)
|
||||||
*
|
*
|
||||||
* This starts a kernel in the manner expected of the multiboot standard.
|
* This starts a kernel in the manner expected of the multiboot standard.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1735,19 +1735,19 @@ install_func (char *arg, int flags)
|
||||||
grub_strcpy (config_file_location, ptr);
|
grub_strcpy (config_file_location, ptr);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *config_file;
|
char *real_config;
|
||||||
unsigned long device;
|
unsigned long device;
|
||||||
|
|
||||||
/* Translate the external device syntax to the internal device
|
/* Translate the external device syntax to the internal device
|
||||||
syntax. */
|
syntax. */
|
||||||
if (! (config_file = set_device (ptr)))
|
if (! (real_config = set_device (ptr)))
|
||||||
{
|
{
|
||||||
/* The Stage 2 PTR does not contain the device name, so
|
/* The Stage 2 PTR does not contain the device name, so
|
||||||
use the root device instead. */
|
use the root device instead. */
|
||||||
errnum = ERR_NONE;
|
errnum = ERR_NONE;
|
||||||
current_drive = saved_drive;
|
current_drive = saved_drive;
|
||||||
current_partition = saved_partition;
|
current_partition = saved_partition;
|
||||||
config_file = ptr;
|
real_config = ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_drive == src_drive)
|
if (current_drive == src_drive)
|
||||||
|
@ -1761,7 +1761,8 @@ install_func (char *arg, int flags)
|
||||||
device = (current_drive << 24) | current_partition;
|
device = (current_drive << 24) | current_partition;
|
||||||
grub_memmove (config_file_location, (char *) &device,
|
grub_memmove (config_file_location, (char *) &device,
|
||||||
sizeof (device));
|
sizeof (device));
|
||||||
grub_strcpy (config_file_location + sizeof (device), config_file);
|
grub_strcpy (config_file_location + sizeof (device),
|
||||||
|
real_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If a Stage 1.5 is used, then we need to modify the Stage2. */
|
/* If a Stage 1.5 is used, then we need to modify the Stage2. */
|
||||||
|
@ -2718,12 +2719,12 @@ setup_func (char *arg, int flags)
|
||||||
/* Point to the string of the drive/parition where the GRUB images
|
/* Point to the string of the drive/parition where the GRUB images
|
||||||
reside. */
|
reside. */
|
||||||
char *image_ptr;
|
char *image_ptr;
|
||||||
unsigned long install_drive, install_partition;
|
unsigned long installed_drive, installed_partition;
|
||||||
unsigned long image_drive, image_partition;
|
unsigned long image_drive, image_partition;
|
||||||
unsigned long tmp_drive, tmp_partition;
|
unsigned long tmp_drive, tmp_partition;
|
||||||
char stage1[64];
|
char stage1[64];
|
||||||
char stage2[64];
|
char stage2[64];
|
||||||
char config_file[64];
|
char config_filename[64];
|
||||||
char cmd_arg[256];
|
char cmd_arg[256];
|
||||||
char device[16];
|
char device[16];
|
||||||
char *buffer = (char *) RAW_ADDR (0x100000);
|
char *buffer = (char *) RAW_ADDR (0x100000);
|
||||||
|
@ -2765,7 +2766,7 @@ setup_func (char *arg, int flags)
|
||||||
/* Initialize some strings. */
|
/* Initialize some strings. */
|
||||||
grub_strcpy (stage1, "/boot/grub/stage1");
|
grub_strcpy (stage1, "/boot/grub/stage1");
|
||||||
grub_strcpy (stage2, "/boot/grub/stage2");
|
grub_strcpy (stage2, "/boot/grub/stage2");
|
||||||
grub_strcpy (config_file, "/boot/grub/menu.lst");
|
grub_strcpy (config_filename, "/boot/grub/menu.lst");
|
||||||
|
|
||||||
tmp_drive = saved_drive;
|
tmp_drive = saved_drive;
|
||||||
tmp_partition = saved_partition;
|
tmp_partition = saved_partition;
|
||||||
|
@ -2785,8 +2786,8 @@ setup_func (char *arg, int flags)
|
||||||
if (errnum)
|
if (errnum)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
install_drive = current_drive;
|
installed_drive = current_drive;
|
||||||
install_partition = current_partition;
|
installed_partition = current_partition;
|
||||||
|
|
||||||
/* Mount the drive pointed by IMAGE_PTR. */
|
/* Mount the drive pointed by IMAGE_PTR. */
|
||||||
if (*image_ptr)
|
if (*image_ptr)
|
||||||
|
@ -2824,7 +2825,7 @@ setup_func (char *arg, int flags)
|
||||||
|
|
||||||
/* If the drive where stage2 resides is a hard disk, try to use a
|
/* If the drive where stage2 resides is a hard disk, try to use a
|
||||||
Stage 1.5. */
|
Stage 1.5. */
|
||||||
if ((image_drive & 0x80) && (install_drive & 0x80))
|
if ((image_drive & 0x80) && (installed_drive & 0x80))
|
||||||
{
|
{
|
||||||
char *fsys = fsys_table[fsys_type].name;
|
char *fsys = fsys_table[fsys_type].name;
|
||||||
int i;
|
int i;
|
||||||
|
@ -2840,14 +2841,14 @@ setup_func (char *arg, int flags)
|
||||||
int blocksize = (filemax + SECTOR_SIZE - 1) >> SECTOR_BITS;
|
int blocksize = (filemax + SECTOR_SIZE - 1) >> SECTOR_BITS;
|
||||||
|
|
||||||
grub_close ();
|
grub_close ();
|
||||||
grub_strcpy (config_file, stage2);
|
grub_strcpy (config_filename, stage2);
|
||||||
grub_strcpy (stage2, stage1_5_map[i].name);
|
grub_strcpy (stage2, stage1_5_map[i].name);
|
||||||
|
|
||||||
if (install_partition == 0xFFFFFF)
|
if (installed_partition == 0xFFFFFF)
|
||||||
{
|
{
|
||||||
/* We install GRUB into the MBR, so try to embed the
|
/* We install GRUB into the MBR, so try to embed the
|
||||||
Stage 1.5 in the sectors right after the MBR. */
|
Stage 1.5 in the sectors right after the MBR. */
|
||||||
sprint_device (install_drive, install_partition);
|
sprint_device (installed_drive, installed_partition);
|
||||||
grub_sprintf (cmd_arg, "%s %s", stage2, device);
|
grub_sprintf (cmd_arg, "%s %s", stage2, device);
|
||||||
|
|
||||||
/* Notify what will be run. */
|
/* Notify what will be run. */
|
||||||
|
@ -2862,8 +2863,8 @@ setup_func (char *arg, int flags)
|
||||||
/* Need to prepend the device name to the
|
/* Need to prepend the device name to the
|
||||||
configuration filename. */
|
configuration filename. */
|
||||||
sprint_device (image_drive, image_partition);
|
sprint_device (image_drive, image_partition);
|
||||||
grub_sprintf (buffer, "%s%s", device, config_file);
|
grub_sprintf (buffer, "%s%s", device, config_filename);
|
||||||
grub_strcpy (config_file, buffer);
|
grub_strcpy (config_filename, buffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -2884,28 +2885,28 @@ setup_func (char *arg, int flags)
|
||||||
|
|
||||||
/* Construct a string that is used by the command "install" as its
|
/* Construct a string that is used by the command "install" as its
|
||||||
arguments. */
|
arguments. */
|
||||||
sprint_device (install_drive, install_partition);
|
sprint_device (installed_drive, installed_partition);
|
||||||
|
|
||||||
#ifdef NO_BUGGY_BIOS_IN_THE_WORLD
|
#ifdef NO_BUGGY_BIOS_IN_THE_WORLD
|
||||||
/* I prefer this, but... */
|
/* I prefer this, but... */
|
||||||
grub_sprintf (cmd_arg, "%s%s %s%s %s p %s",
|
grub_sprintf (cmd_arg, "%s%s %s%s %s p %s",
|
||||||
is_force_lba? "--force-lba " : "",
|
is_force_lba? "--force-lba " : "",
|
||||||
stage1,
|
stage1,
|
||||||
(install_drive != image_drive) ? "d " : "",
|
(installed_drive != image_drive) ? "d " : "",
|
||||||
device,
|
device,
|
||||||
stage2,
|
stage2,
|
||||||
config_file);
|
config_filename);
|
||||||
#else /* ! NO_BUGGY_BIOS_IN_THE_WORLD */
|
#else /* ! NO_BUGGY_BIOS_IN_THE_WORLD */
|
||||||
/* Actually, there are several buggy BIOSes in the world, so we
|
/* Actually, there are several buggy BIOSes in the world, so we
|
||||||
may not expect that your BIOS will pass a booting drive to stage1
|
may not expect that your BIOS will pass a booting drive to stage1
|
||||||
correctly. Thus, always specify the option `d', whether
|
correctly. Thus, always specify the option `d', whether
|
||||||
INSTALL_DRIVE is identical with IMAGE_DRIVE or not. *sigh* */
|
INSTALLED_DRIVE is identical with IMAGE_DRIVE or not. *sigh* */
|
||||||
grub_sprintf (cmd_arg, "%s%s d %s %s p %s",
|
grub_sprintf (cmd_arg, "%s%s d %s %s p %s",
|
||||||
is_force_lba? "--force-lba " : "",
|
is_force_lba? "--force-lba " : "",
|
||||||
stage1,
|
stage1,
|
||||||
device,
|
device,
|
||||||
stage2,
|
stage2,
|
||||||
config_file);
|
config_filename);
|
||||||
#endif /* ! NO_BUGGY_BIOS_IN_THE_WORLD */
|
#endif /* ! NO_BUGGY_BIOS_IN_THE_WORLD */
|
||||||
|
|
||||||
/* Notify what will be run. */
|
/* Notify what will be run. */
|
||||||
|
|
|
@ -64,9 +64,9 @@ convert_to_ascii (char *buf, int c,...)
|
||||||
char *ptr2 = buf;
|
char *ptr2 = buf;
|
||||||
while (ptr1 > ptr2)
|
while (ptr1 > ptr2)
|
||||||
{
|
{
|
||||||
int c = *ptr1;
|
int tmp = *ptr1;
|
||||||
*ptr1 = *ptr2;
|
*ptr1 = *ptr2;
|
||||||
*ptr2 = c;
|
*ptr2 = tmp;
|
||||||
ptr1--;
|
ptr1--;
|
||||||
ptr2++;
|
ptr2++;
|
||||||
}
|
}
|
||||||
|
@ -228,14 +228,14 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
|
||||||
/* The working buffer for the command-line. */
|
/* The working buffer for the command-line. */
|
||||||
char *buf = (char *) CMDLINE_BUF;
|
char *buf = (char *) CMDLINE_BUF;
|
||||||
/* The kill buffer. */
|
/* The kill buffer. */
|
||||||
char *kill = (char *) KILL_BUF;
|
char *kill_buf = (char *) KILL_BUF;
|
||||||
|
|
||||||
/* nested function definition for code simplicity */
|
/* nested function definition for code simplicity */
|
||||||
static void cl_print (char *str, int echo_char)
|
static void cl_print (char *str, int real_echo_char)
|
||||||
{
|
{
|
||||||
while (*str != 0)
|
while (*str != 0)
|
||||||
{
|
{
|
||||||
putchar (echo_char ? echo_char : *str);
|
putchar (real_echo_char ? real_echo_char : *str);
|
||||||
str++;
|
str++;
|
||||||
if (++xend > 78)
|
if (++xend > 78)
|
||||||
{
|
{
|
||||||
|
@ -465,9 +465,9 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
|
||||||
case 21: /* C-u kill to beginning of line */
|
case 21: /* C-u kill to beginning of line */
|
||||||
if (lpos == 0)
|
if (lpos == 0)
|
||||||
break;
|
break;
|
||||||
/* Copy the string being deleted to KILL. */
|
/* Copy the string being deleted to KILL_BUF. */
|
||||||
grub_memmove (kill, buf, lpos);
|
grub_memmove (kill_buf, buf, lpos);
|
||||||
kill[lpos] = 0;
|
kill_buf[lpos] = 0;
|
||||||
grub_memmove (buf, buf + lpos, llen - lpos + 1);
|
grub_memmove (buf, buf + lpos, llen - lpos + 1);
|
||||||
lpos = llen - lpos;
|
lpos = llen - lpos;
|
||||||
cl_setcpos ();
|
cl_setcpos ();
|
||||||
|
@ -480,12 +480,12 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
|
||||||
case 11: /* C-k kill to end of line */
|
case 11: /* C-k kill to end of line */
|
||||||
if (lpos == llen)
|
if (lpos == llen)
|
||||||
break;
|
break;
|
||||||
/* Copy the string being deleted to KILL. */
|
/* Copy the string being deleted to KILL_BUF. */
|
||||||
grub_memmove (kill, buf + lpos, llen - lpos + 1);
|
grub_memmove (kill_buf, buf + lpos, llen - lpos + 1);
|
||||||
cl_kill_to_end ();
|
cl_kill_to_end ();
|
||||||
break;
|
break;
|
||||||
case 25: /* C-y yank the kill buffer */
|
case 25: /* C-y yank the kill buffer */
|
||||||
cl_insert (kill);
|
cl_insert (kill_buf);
|
||||||
break;
|
break;
|
||||||
case 16: /* C-p fetch the previous command */
|
case 16: /* C-p fetch the previous command */
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
#define i_nlink ic_nlink
|
#define i_nlink ic_nlink
|
||||||
#define i_uid ic_uid
|
#define i_uid ic_uid
|
||||||
#define i_gid ic_gid
|
#define i_gid ic_gid
|
||||||
#if BYTE_MSF
|
#if defined(BYTE_MSF) && BYTE_MSF
|
||||||
#define i_size ic_size.val[1]
|
#define i_size ic_size.val[1]
|
||||||
#else /* BYTE_LSF */
|
#else /* BYTE_LSF */
|
||||||
#define i_size ic_size.val[0]
|
#define i_size ic_size.val[0]
|
||||||
|
|
|
@ -636,7 +636,7 @@ ext2fs_dir (char *dirname)
|
||||||
memmove (linkbuf, (char *) INODE->i_block, len);
|
memmove (linkbuf, (char *) INODE->i_block, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if E2DEBUG
|
#ifdef E2DEBUG
|
||||||
printf ("symlink=%s\n", linkbuf);
|
printf ("symlink=%s\n", linkbuf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* fsys_reiserfs.c - an implementation for the ReiserFS filesystem */
|
||||||
/*
|
/*
|
||||||
* GRUB -- GRand Unified Bootloader
|
* GRUB -- GRand Unified Bootloader
|
||||||
* Copyright (C) 2000 Free Software Foundation, Inc.
|
* Copyright (C) 2000 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -611,7 +611,7 @@ void linux_boot (void) __attribute__ ((noreturn));
|
||||||
void big_linux_boot (void) __attribute__ ((noreturn));
|
void big_linux_boot (void) __attribute__ ((noreturn));
|
||||||
|
|
||||||
/* booting a multiboot executable */
|
/* booting a multiboot executable */
|
||||||
void multi_boot (int start, int mbi) __attribute__ ((noreturn));
|
void multi_boot (int start, int mb_info) __attribute__ ((noreturn));
|
||||||
|
|
||||||
/* If LINEAR is nonzero, then set the Intel processor to linear mode.
|
/* If LINEAR is nonzero, then set the Intel processor to linear mode.
|
||||||
Otherwise, bit 20 of all memory accesses is always forced to zero,
|
Otherwise, bit 20 of all memory accesses is always forced to zero,
|
||||||
|
@ -688,7 +688,7 @@ void set_attrib (int attr);
|
||||||
|
|
||||||
/* Low-level disk I/O */
|
/* Low-level disk I/O */
|
||||||
int get_diskinfo (int drive, struct geometry *geometry);
|
int get_diskinfo (int drive, struct geometry *geometry);
|
||||||
int biosdisk (int read, int drive, struct geometry *geometry,
|
int biosdisk (int subfunc, int drive, struct geometry *geometry,
|
||||||
int sector, int nsec, int segment);
|
int sector, int nsec, int segment);
|
||||||
void stop_floppy (void);
|
void stop_floppy (void);
|
||||||
|
|
||||||
|
|
|
@ -465,7 +465,7 @@ restart:
|
||||||
{
|
{
|
||||||
if (c == 'e')
|
if (c == 'e')
|
||||||
{
|
{
|
||||||
int num_entries = 0, i = 0;
|
int new_num_entries = 0, i = 0;
|
||||||
char *new_heap;
|
char *new_heap;
|
||||||
|
|
||||||
if (config_entries)
|
if (config_entries)
|
||||||
|
@ -487,7 +487,7 @@ restart:
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
while ((*(new_heap++) = cur_entry[i++]) != 0);
|
while ((*(new_heap++) = cur_entry[i++]) != 0);
|
||||||
num_entries++;
|
new_num_entries++;
|
||||||
}
|
}
|
||||||
while (config_entries && cur_entry[i]);
|
while (config_entries && cur_entry[i]);
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ restart:
|
||||||
*(new_heap++) = 0;
|
*(new_heap++) = 0;
|
||||||
|
|
||||||
if (config_entries)
|
if (config_entries)
|
||||||
run_menu (heap, NULL, num_entries, new_heap, 0);
|
run_menu (heap, NULL, new_num_entries, new_heap, 0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cls ();
|
cls ();
|
||||||
|
@ -646,13 +646,13 @@ cmain (void)
|
||||||
{
|
{
|
||||||
int config_len, menu_len, num_entries;
|
int config_len, menu_len, num_entries;
|
||||||
char *config_entries, *menu_entries;
|
char *config_entries, *menu_entries;
|
||||||
char *kill = (char *) KILL_BUF;
|
char *kill_buf = (char *) KILL_BUF;
|
||||||
|
|
||||||
/* Initialize the environment for restarting Stage 2. */
|
/* Initialize the environment for restarting Stage 2. */
|
||||||
grub_setjmp (restart_env);
|
grub_setjmp (restart_env);
|
||||||
|
|
||||||
/* Initialize the kill buffer. */
|
/* Initialize the kill buffer. */
|
||||||
*kill = 0;
|
*kill_buf = 0;
|
||||||
|
|
||||||
/* Never return. */
|
/* Never return. */
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
@ -31,8 +31,6 @@ mandir = @mandir@
|
||||||
includedir = @includedir@
|
includedir = @includedir@
|
||||||
oldincludedir = /usr/include
|
oldincludedir = /usr/include
|
||||||
|
|
||||||
DESTDIR =
|
|
||||||
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
@ -57,6 +55,8 @@ POST_INSTALL = :
|
||||||
NORMAL_UNINSTALL = :
|
NORMAL_UNINSTALL = :
|
||||||
PRE_UNINSTALL = :
|
PRE_UNINSTALL = :
|
||||||
POST_UNINSTALL = :
|
POST_UNINSTALL = :
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
host_alias = @host_alias@
|
host_alias = @host_alias@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
AMDEP = @AMDEP@
|
AMDEP = @AMDEP@
|
||||||
|
@ -118,13 +118,14 @@ CFLAGS = @CFLAGS@
|
||||||
CCLD = $(CC)
|
CCLD = $(CC)
|
||||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
DIST_SOURCES = $(mbchk_SOURCES)
|
DIST_SOURCES = $(mbchk_SOURCES)
|
||||||
|
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||||
|
DEP_FILES = @AMDEP@ $(DEPDIR)/mbchk.Po
|
||||||
DIST_COMMON = Makefile.am Makefile.in grub-image.in grub-install.in
|
DIST_COMMON = Makefile.am Makefile.in grub-image.in grub-install.in
|
||||||
|
|
||||||
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
GZIP_ENV = --best
|
GZIP_ENV = --best
|
||||||
DEP_FILES = .deps/mbchk.P
|
|
||||||
SOURCES = $(mbchk_SOURCES)
|
SOURCES = $(mbchk_SOURCES)
|
||||||
OBJECTS = $(am_mbchk_OBJECTS)
|
OBJECTS = $(am_mbchk_OBJECTS)
|
||||||
|
|
||||||
|
@ -134,7 +135,7 @@ all: all-redirect
|
||||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile
|
cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile
|
||||||
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
cd $(top_builddir) \
|
cd $(top_builddir) \
|
||||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||||
|
|
||||||
|
@ -206,8 +207,6 @@ uninstall-sbinSCRIPTS:
|
||||||
echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
|
echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
|
||||||
rm -f $(DESTDIR)$(sbindir)/$$f; \
|
rm -f $(DESTDIR)$(sbindir)/$$f; \
|
||||||
done
|
done
|
||||||
.c.o:
|
|
||||||
$(COMPILE) -c $<
|
|
||||||
|
|
||||||
tags: TAGS
|
tags: TAGS
|
||||||
|
|
||||||
|
@ -218,7 +217,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
done | \
|
done | \
|
||||||
$(AWK) ' { files[$$0] = 1; } \
|
$(AWK) ' { files[$$0] = 1; } \
|
||||||
END { for (i in files) print i; }'`; \
|
END { for (i in files) print i; }'`; \
|
||||||
mkid -f$$here/ID $$unique $(LISP)
|
mkid -fID $$unique $(LISP)
|
||||||
|
|
||||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
$(TAGS_FILES) $(LISP)
|
$(TAGS_FILES) $(LISP)
|
||||||
|
@ -242,56 +241,40 @@ distclean-tags:
|
||||||
|
|
||||||
maintainer-clean-tags:
|
maintainer-clean-tags:
|
||||||
|
|
||||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
@AMDEP@include $(DEPDIR)/mbchk.Po
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
|
||||||
here=`cd $(top_builddir) && pwd`; \
|
|
||||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
|
||||||
distdir=`cd $(distdir) && pwd`; \
|
|
||||||
cd $(top_srcdir) \
|
|
||||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu util/Makefile
|
|
||||||
@for file in $(DISTFILES); do \
|
|
||||||
d=$(srcdir); \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
|
||||||
else \
|
|
||||||
test -f $(distdir)/$$file \
|
|
||||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
|
||||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
|
|
||||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
|
||||||
|
|
||||||
-include $(DEP_FILES)
|
|
||||||
|
|
||||||
mostlyclean-depend:
|
mostlyclean-depend:
|
||||||
|
|
||||||
clean-depend:
|
clean-depend:
|
||||||
|
|
||||||
distclean-depend:
|
distclean-depend:
|
||||||
-rm -rf .deps
|
-rm -rf $(DEPDIR)
|
||||||
|
|
||||||
maintainer-clean-depend:
|
maintainer-clean-depend:
|
||||||
|
|
||||||
%.o: %.c
|
@AMDEP@CCDEPMODE = @CCDEPMODE@
|
||||||
@echo '$(COMPILE) -c -o $@ $<'; \
|
|
||||||
$(COMPILE) -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
|
|
||||||
@-cp .deps/$(*D)/$(*F).pp .deps/$(*D)/$(*F).P; \
|
|
||||||
tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
|
|
||||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
|
||||||
>> .deps/$(*D)/$(*F).P; \
|
|
||||||
rm .deps/$(*D)/$(*F).pp
|
|
||||||
|
|
||||||
%.lo: %.c
|
.c.o:
|
||||||
@echo '$(LTCOMPILE) -c -o $@ $<'; \
|
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||||
$(LTCOMPILE) -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
|
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||||
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
|
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
< .deps/$(*D)/$(*F).pp > .deps/$(*D)/$(*F).P; \
|
$(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
|
||||||
tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
|
|
||||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
|
||||||
>> .deps/$(*D)/$(*F).P; \
|
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||||
rm -f .deps/$(*D)/$(*F).pp
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@for file in $(DISTFILES); do \
|
||||||
|
d=$(srcdir); \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
cp -pR $$d/$$file $(distdir) \
|
||||||
|
|| exit 1; \
|
||||||
|
else \
|
||||||
|
test -f $(distdir)/$$file \
|
||||||
|
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
info-am:
|
info-am:
|
||||||
info: info-am
|
info: info-am
|
||||||
dvi-am:
|
dvi-am:
|
||||||
|
@ -328,6 +311,7 @@ distclean-generic:
|
||||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||||
|
|
||||||
maintainer-clean-generic:
|
maintainer-clean-generic:
|
||||||
|
-rm -f Makefile.in
|
||||||
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
|
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
|
||||||
mostlyclean-tags mostlyclean-depend mostlyclean-generic
|
mostlyclean-tags mostlyclean-depend mostlyclean-generic
|
||||||
|
|
||||||
|
@ -357,8 +341,8 @@ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
|
||||||
mostlyclean-compile distclean-compile clean-compile \
|
mostlyclean-compile distclean-compile clean-compile \
|
||||||
maintainer-clean-compile uninstall-sbinSCRIPTS install-sbinSCRIPTS tags \
|
maintainer-clean-compile uninstall-sbinSCRIPTS install-sbinSCRIPTS tags \
|
||||||
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
|
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
|
||||||
distdir mostlyclean-depend distclean-depend clean-depend \
|
mostlyclean-depend distclean-depend clean-depend \
|
||||||
maintainer-clean-depend info-am info dvi-am dvi check check-am \
|
maintainer-clean-depend distdir info-am info dvi-am dvi check check-am \
|
||||||
installcheck-am installcheck install-exec-am install-exec \
|
installcheck-am installcheck install-exec-am install-exec \
|
||||||
install-data-am install-data install-am install uninstall-am uninstall \
|
install-data-am install-data install-am install uninstall-am uninstall \
|
||||||
all-redirect all-am all install-strip installdirs mostlyclean-generic \
|
all-redirect all-am all install-strip installdirs mostlyclean-generic \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue