Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv18957/ntfstools
Modified Files:
mkntfs.c
Log Message:
fix backup boot sector problem with error message instead of crashing out. we
rely on chkdsk to fix this as it is a kernel limitation we can't do anything
about atm.
Index: mkntfs.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/mkntfs.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -U2 -r1.30 -r1.31
--- mkntfs.c 2001/06/13 00:13:38 1.30
+++ mkntfs.c 2001/06/13 01:35:02 1.31
@@ -3272,8 +3272,4 @@
* last sector.
*/
- i = max(512, opt.sector_size);
- Dprintf("i = %i\n", i);
- Dprintf("(opt.nr_sectors + 1) * opt.sector_size - i = %Li\n",
- (off_t)((opt.nr_sectors + 1) * opt.sector_size - i));
if (lseek(f, (opt.nr_sectors + 1) * opt.sector_size - i, SEEK_SET) ==
(off_t)-1)
@@ -3283,11 +3279,18 @@
buf2 = NULL;
if (bw != i) {
+ int _e = errno;
char *_s;
if (bw == -1LL)
- _s = strerror(errno);
+ _s = strerror(_e);
else
_s = "unknown error";
- err_exit("Couldn't write backup boot sector: %s\n", _s);
+ if (bw != -1LL || (bw == -1LL && _e != ENOSPC))
+ err_exit("Couldn't write backup boot sector: %s\n", _s);
+ Eprintf("Couldn't write backup boot sector. This is due to a "
+ "limitation in the\nLinux kernel. This is not "
+ "a major problem as Windows check disk will "
+ "create the\nbackup boot sector when it "
+ "is run on your next boot into Windows.\n");
}
/*
|