/[grub]/grub/lib/device.c
ViewVC logotype

Diff of /grub/lib/device.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by okuji, Tue Feb 1 21:00:42 2005 UTC revision 1.26 by okuji, Sun Mar 27 23:20:09 2005 UTC
# Line 1  Line 1 
1  /* device.c - Some helper functions for OS devices and BIOS drives */  /* device.c - Some helper functions for OS devices and BIOS drives */
2  /*  /*
3   *  GRUB  --  GRand Unified Bootloader   *  GRUB  --  GRand Unified Bootloader
4   *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.   *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005  Free Software Foundation, Inc.
5   *   *
6   *  This program is free software; you can redistribute it and/or modify   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by   *  it under the terms of the GNU General Public License as published by
# Line 248  partially. This is not fatal." Line 248  partially. This is not fatal."
248        }        }
249    
250      /* Set the total sectors properly, if we can. */      /* Set the total sectors properly, if we can. */
251      if (! fstat (fd, &st) && st.st_blocks)      if (! fstat (fd, &st) && st.st_size)
252        geom->total_sectors = st.st_blocks;        geom->total_sectors = st.st_size >> SECTOR_BITS;
253      else      else
254        geom->total_sectors = geom->cylinders * geom->heads * geom->sectors;        geom->total_sectors = geom->cylinders * geom->heads * geom->sectors;
255    }    }

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26