~ubuntu-branches/ubuntu/utopic/gdisk/utopic-proposed

« back to all changes in this revision

Viewing changes to diskio-windows.cc

  • Committer: Bazaar Package Importer
  • Author(s): Guillaume Delacour
  • Date: 2011-10-03 20:46:30 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20111003204630-3cl1nosx48ofyig8
Tags: 0.8.1-1
* New upstream release
* debian/rules: Install cgdisk binary (curses based)
* debian/manpages: Install cgdisk manpage
* debian/control:
  + Remove Intel-based from description thanks Witold Baryluk
  (Closes: #642363)
  + Add libncurses5-dev in Build-Depends
* debian/copyright: Change to new DEP-5 format
* debian/patches/manpages.diff: Refresh patch to escape two hyphen

Show diffs side-by-side

added added

removed removed

Lines of Context:
158
158
 
159
159
// Resync disk caches so the OS uses the new partition table. This code varies
160
160
// a lot from one OS to another.
161
 
void DiskIO::DiskSync(void) {
 
161
// Returns 1 on success, 0 if the kernel continues to use the old partition table.
 
162
int DiskIO::DiskSync(void) {
162
163
   DWORD i;
163
164
   GET_LENGTH_INFORMATION buf;
 
165
   int retval = 0;
164
166
 
165
167
   // If disk isn't open, try to open it....
166
168
   if (!openForWrite) {
174
176
      } else {
175
177
         cout << "Disk synchronization succeeded! The computer should now use the new\n"
176
178
              << "partition table.\n";
 
179
         retval = 1;
177
180
      } // if/else
178
181
   } else {
179
182
      cout << "Unable to open the disk for synchronization operation! The computer will\n"
180
183
           << "continue to use the old partition table until you reboot or remove and\n"
181
184
           << "re-insert the disk!\n";
182
185
   } // if (isOpen)
 
186
   return retval;
183
187
} // DiskIO::DiskSync()
184
188
 
185
189
// Seek to the specified sector. Returns 1 on success, 0 on failure.