Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19030/ntfsprogs
Modified Files:
mkntfs.c
Log Message:
mkntfs: Fix backup bootsector creation. Thanks to Timur Amirkhanov
for pointing this stupidity out. (We forgot to set the size before
doing it.) (Anton)
Index: mkntfs.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/mkntfs.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -p -r1.59 -r1.60
--- mkntfs.c 6 Jul 2005 22:47:18 -0000 1.59
+++ mkntfs.c 9 Jul 2005 21:24:02 -0000 1.60
@@ -3255,17 +3255,20 @@ static void create_file_volume(MFT_RECOR
*
* Return 0 on success or 1 if it couldn't be created.
*/
-static int create_backup_boot_sector(u8 *buff, int size)
+static int create_backup_boot_sector(u8 *buff)
{
- ssize_t bw;
- int _e = errno;
const char *_s;
+ ssize_t bw;
+ int size, _e = errno;
Vprintf("Creating backup boot sector.\n");
/*
* Write the first max(512, opts.sector_size) bytes from buf to the
* last sector.
*/
+ size = 512;
+ if (size < opts.sector_size)
+ size = opts.sector_size;
if (vol->dev->d_ops->seek(vol->dev, (opts.nr_sectors + 1) *
opts.sector_size - size, SEEK_SET) == (off_t)-1)
goto bb_err;
@@ -3598,7 +3601,7 @@ static void mkntfs_create_root_structure
if (err < 0)
err_exit("Couldn't create $Boot: %s\n", strerror(-err));
- if (create_backup_boot_sector(buf2, i) != 0) {
+ if (create_backup_boot_sector(buf2) != 0) {
/*
* Pre-2.6 kernels couldn't access the last sector
* if it was odd hence we schedule chkdsk to create it.
|