mirror of
https://github.com/openharmony/third_party_gptfdisk.git
synced 2026-07-01 13:17:25 -04:00
update: 更新文件 diskio-unix.cc
Signed-off-by: jiangqianrong <jiangqianrong1@huawei.com>
This commit is contained in:
@@ -258,24 +258,6 @@ uint32_t DiskIO::GetNumSecsPerTrack(void) {
|
||||
return numSecs;
|
||||
} // DiskIO::GetNumSecsPerTrack()
|
||||
|
||||
static int IoctlRetry(int fd) {
|
||||
int ret = -1;
|
||||
int etry_count = 0;
|
||||
const int max_retries = 6;
|
||||
const int retry_delay_us = 50000;
|
||||
|
||||
while (retry_count < max_retries) {
|
||||
ret = ioctl(fd, BLKRRPART);
|
||||
if (ret == 0) {
|
||||
break;
|
||||
}
|
||||
retry_count++;
|
||||
usleep(retry_delay_us * retry_count);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Resync disk caches so the OS uses the new partition table. This code varies
|
||||
// a lot from one OS to another.
|
||||
// Returns 1 on success, 0 if the kernel continues to use the old partition table.
|
||||
|
||||
Reference in New Issue
Block a user