activate emile_map_partition_set_flags and emile_map_set_partition_type

This commit is contained in:
Laurent Vivier 2004-12-27 22:34:59 +00:00
parent 45201900ef
commit c3f49c0382

View File

@ -71,7 +71,7 @@ int main(int argc, char** argv)
return 0; return 0;
case ARG_FLAGS: case ARG_FLAGS:
action |= ACTION_FLAGS; action |= ACTION_FLAGS;
flags = atoi(optarg); flags = strtol(optarg, NULL, 0);
break; break;
case ARG_TYPE: case ARG_TYPE:
action |= ACTION_TYPE; action |= ACTION_TYPE;
@ -98,6 +98,13 @@ int main(int argc, char** argv)
return 1; return 1;
} }
if (partition == 0)
{
fprintf(stderr,
"ERROR: you must provide device of a partition\n");
return 1;
}
sprintf(disk_name, "%s%c", driver, 'a' + disk); sprintf(disk_name, "%s%c", driver, 'a' + disk);
if (action & ACTION_STARTUP) if (action & ACTION_STARTUP)
@ -131,10 +138,22 @@ int main(int argc, char** argv)
return 5; return 5;
} }
printf("flags %d (%x) type %s\n", flags, flags, type); if (action & ACTION_FLAGS)
#if 0 {
emile_map_set_flags(map, flags); emile_map_partition_set_flags(map, flags);
emile_map_set_partition_type(map, type); }
if (action & ACTION_TYPE)
{
ret = emile_map_set_partition_type(map, type);
if (ret == -1)
{
fprintf(stderr,
"ERROR: cannot set partition type to %s\n", type);
return 6;
}
}
ret = emile_map_write(map, partition - 1); ret = emile_map_write(map, partition - 1);
if (ret != partition - 1) if (ret != partition - 1)
{ {
@ -143,7 +162,6 @@ int main(int argc, char** argv)
return 5; return 5;
} }
#endif
emile_map_close(map); emile_map_close(map);
return 0; return 0;