2004-03-14 Jeroen Dekkers <jeroen@dekkers.cx>
* Makefile.in: Update copyright. * genmodsrc.sh: Likewise. * gensymlist.sh: Likewise. * term/i386/pc/vga.c: Indent correctly. * util/i386/pc/pupa-mkimage.c (usage): Use PACKAGE_BUGREPORT as bugreporting address. * util/i386/pc/pupa-setup.c (usage): Likewise, (main): Call pupa_ext2_init and pupa_ext2_fini. * fs/fat.c (log2): Renamed to ... (fat_log2): ... this. All callers changed. * kern/misc.c (memcpy): Alias to pupa_memmove. * loader/i386/pc/multiboot.c (pupa_rescue_cmd_multiboot): Fix lvalue cast. * util/console.c (pupa_ncurses_fini): Return 0. * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open)[__linux__]: Move fail label here. [__GNU__]: Don't warn when using stat. (open_device)[!__linux__]: Check if FD < 0 instead of !FD. (pupa_util_biosdisk_get_pupa_dev)[__GNU__]: Change type of N to long int. Use strtol instead of strtoul.
This commit is contained in:
parent
db1771cfbe
commit
8c8cc20511
12 changed files with 149 additions and 115 deletions
|
@ -1,7 +1,7 @@
|
|||
/* biosdisk.c - emulate biosdisk */
|
||||
/*
|
||||
* PUPA -- Preliminary Universal Programming Architecture for GRUB
|
||||
* Copyright (C) 1999,2000,2001,2002,2003 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
|
||||
*
|
||||
* PUPA is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -190,11 +190,12 @@ pupa_util_biosdisk_open (const char *name, pupa_disk_t disk)
|
|||
|
||||
return PUPA_ERR_NONE;
|
||||
}
|
||||
#else
|
||||
# warning "No special routine to get the size of a block device is implemented for your OS. This is not possibly fatal."
|
||||
#endif
|
||||
|
||||
fail:
|
||||
/* In GNU/Hurd, stat() will return the right size. */
|
||||
#elif !defined (__GNU__)
|
||||
# warning "No special routine to get the size of a block device is implemented for your OS. This is not possibly fatal."
|
||||
#endif
|
||||
if (stat (map[drive], &st) < 0)
|
||||
return pupa_error (PUPA_ERR_BAD_DEVICE, "cannot stat `%s'", map[drive]);
|
||||
|
||||
|
@ -325,7 +326,7 @@ open_device (const pupa_disk_t disk, unsigned long sector, int flags)
|
|||
}
|
||||
#else /* ! __linux__ */
|
||||
fd = open (map[disk->id], flags);
|
||||
if (! fd)
|
||||
if (fd < 0)
|
||||
{
|
||||
pupa_error (PUPA_ERR_BAD_DEVICE, "cannot open `%s'", map[disk->id]);
|
||||
return -1;
|
||||
|
@ -815,11 +816,11 @@ pupa_util_biosdisk_get_pupa_dev (const char *os_dev)
|
|||
p = strrchr (os_dev, 's');
|
||||
if (p)
|
||||
{
|
||||
unsigned long n;
|
||||
long int n;
|
||||
char *q;
|
||||
|
||||
p++;
|
||||
n = strtoul (p, &q, 10);
|
||||
n = strtol (p, &q, 10);
|
||||
if (p != q && n != LONG_MIN && n != LONG_MAX)
|
||||
{
|
||||
dos_part = (int) n;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue