diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2011-09-10 20:30:20 -0400 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2011-09-10 20:30:20 -0400 |
commit | a17fe69ec07c93a24894e4c4243f05af2bfc5bd7 (patch) | |
tree | e79312858bcf530d1d27d7112dd03e433c947b44 /diskio-windows.cc | |
parent | 3860cbe1cafb88d70097bdfb8d84cc0029f1738e (diff) | |
download | sgdisk-a17fe69ec07c93a24894e4c4243f05af2bfc5bd7.tar.gz |
Changes for version 0.8.0
Diffstat (limited to 'diskio-windows.cc')
-rw-r--r-- | diskio-windows.cc | 6 |
1 files changed, 5 insertions, 1 deletions
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. |