From a17fe69ec07c93a24894e4c4243f05af2bfc5bd7 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Sat, 10 Sep 2011 20:30:20 -0400 Subject: Changes for version 0.8.0 --- diskio-windows.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'diskio-windows.cc') diff --git a/diskio-windows.cc b/diskio-windows.cc index 37e5bb5..af191a8 100644 --- a/diskio-windows.cc +++ b/diskio-windows.cc @@ -158,9 +158,11 @@ uint32_t DiskIO::GetNumSecsPerTrack(void) { // Resync disk caches so the OS uses the new partition table. This code varies // a lot from one OS to another. -void DiskIO::DiskSync(void) { +// Returns 1 on success, 0 if the kernel continues to use the old partition table. +int DiskIO::DiskSync(void) { DWORD i; GET_LENGTH_INFORMATION buf; + int retval = 0; // If disk isn't open, try to open it.... if (!openForWrite) { @@ -174,12 +176,14 @@ void DiskIO::DiskSync(void) { } else { cout << "Disk synchronization succeeded! The computer should now use the new\n" << "partition table.\n"; + retval = 1; } // if/else } else { cout << "Unable to open the disk for synchronization operation! The computer will\n" << "continue to use the old partition table until you reboot or remove and\n" << "re-insert the disk!\n"; } // if (isOpen) + return retval; } // DiskIO::DiskSync() // Seek to the specified sector. Returns 1 on success, 0 on failure. -- cgit v1.2.1