MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / warning_geometry

Function warning_geometry

src/godmode.c:1336–1353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1334}
1335
1336static void warning_geometry(const list_part_t *list_part, disk_t *disk, const int verbose, char **current_cmd)
1337{
1338 if(list_part!=NULL && (disk->arch==&arch_i386 || disk->arch==&arch_sun))
1339 { /* Correct disk geometry is necessary for successfull Intel and Sun partition recovery */
1340 const unsigned int heads_per_cylinder=get_geometry_from_list_part(disk, list_part, verbose);
1341 if(disk->geom.heads_per_cylinder!=heads_per_cylinder)
1342 {
1343 log_warning("Warning: the current number of heads per cylinder is %u but the correct value may be %u.\n",
1344 disk->geom.heads_per_cylinder, heads_per_cylinder);
1345#ifdef HAVE_NCURSES
1346 if(*current_cmd==NULL)
1347 {
1348 warning_geometry_ncurses(disk, heads_per_cylinder);
1349 }
1350#endif
1351 }
1352 }
1353}
1354
1355/*@
1356 @ requires valid_list_part(list_part_org);

Callers 1

interface_recoveryFunction · 0.85

Calls 2

warning_geometry_ncursesFunction · 0.85

Tested by

no test coverage detected