-/* $OpenBSD: fdisk.c,v 1.141 2021/12/11 20:09:28 krw Exp $ */
+/* $OpenBSD: fdisk.c,v 1.142 2022/02/04 23:32:17 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
fprintf(stderr, "usage: %s "
"[-evy] [-A | -g | -i | -u] [-b blocks[@offset[:type]]]\n"
- "\t[-l blocks | -c cylinders -h heads -s sectors] [-f mbrfile] disk\n",
- __progname);
+ "\t[-l blocks | -c cylinders -h heads -s sectors] [-f mbrfile] "
+ "disk\n", __progname);
exit(1);
}
init = INIT_MBR;
break;
case 'l':
- disk.dk_size = strtonum(optarg, BLOCKALIGNMENT, UINT32_MAX, &errstr);
+ disk.dk_size = strtonum(optarg, BLOCKALIGNMENT,
+ UINT32_MAX, &errstr);
if (errstr)
errx(1, "Block argument %s [%u..%u].", errstr,
BLOCKALIGNMENT, UINT32_MAX);
-/* $OpenBSD: gpt.c,v 1.57 2022/02/04 14:07:56 krw Exp $ */
+/* $OpenBSD: gpt.c,v 1.58 2022/02/04 23:32:17 krw Exp $ */
/*
* Copyright (c) 2015 Markus Muller <mmu@grummel.net>
* Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org>
return -1;
for (i = 0; i < NDOSPART; i++) {
- PRT_make(&mbr->mbr_prt[i], mbr->mbr_lba_self, mbr->mbr_lba_firstembr,
- &dos_partition);
+ PRT_make(&mbr->mbr_prt[i], mbr->mbr_lba_self,
+ mbr->mbr_lba_firstembr, &dos_partition);
memcpy(&dp[i], &dos_partition, sizeof(dp[i]));
}
printf("gh_gh_guid : %s\n", (status == uuid_s_ok) ? p : "<invalid>");
free(p);
printf("gh_gh_part_lba : %llu\n", letoh64(gh.gh_part_lba));
- printf("gh_gh_part_num : %u (%zu)\n", letoh32(gh.gh_part_num), nitems(gp));
- printf("gh_gh_part_size: %u (%zu)\n", letoh32(gh.gh_part_size), sizeof(gp[0]));
+ printf("gh_gh_part_num : %u (%zu)\n", letoh32(gh.gh_part_num),
+ nitems(gp));
+ printf("gh_gh_part_size: %u (%zu)\n", letoh32(gh.gh_part_size),
+ sizeof(gp[0]));
printf("gh_gh_part_csum: 0x%x\n", letoh32(gh.gh_part_csum));
printf("\n");
#endif /* DEBUG */
-/* $OpenBSD: mbr.c,v 1.117 2022/02/04 18:21:33 krw Exp $ */
+/* $OpenBSD: mbr.c,v 1.118 2022/02/04 23:32:17 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
dos_mbr->dmbr_sign = htole16(DOSMBR_SIGNATURE);
for (i = 0; i < NDOSPART; i++) {
- PRT_make(&mbr->mbr_prt[i], mbr->mbr_lba_self, mbr->mbr_lba_firstembr,
- &dos_partition);
+ PRT_make(&mbr->mbr_prt[i], mbr->mbr_lba_self,
+ mbr->mbr_lba_firstembr, &dos_partition);
memcpy(&dos_mbr->dmbr_parts[i], &dos_partition,
sizeof(dos_mbr->dmbr_parts[i]));
}
-/* $OpenBSD: part.c,v 1.115 2022/02/04 14:07:56 krw Exp $ */
+/* $OpenBSD: part.c,v 1.116 2022/02/04 23:32:17 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
printf("%02X %s %02X %s %02X %s",
mbr_types[i].mt_type, mbr_types[i].mt_sname,
mbr_types[i+idrows].mt_type, mbr_types[i+idrows].mt_sname,
- mbr_types[i+idrows*2].mt_type, mbr_types[i+idrows*2].mt_sname);
+ mbr_types[i+idrows*2].mt_type,
+ mbr_types[i+idrows*2].mt_sname);
if ((i+idrows*3) < nitems(mbr_types)) {
printf(" %02X %s\n",
mbr_types[i+idrows*3].mt_type,
printf("%02X %s %02X %s %02X %s",
gpt_types[i].gt_type, gpt_types[i].gt_sname,
gpt_types[i+idrows].gt_type, gpt_types[i+idrows].gt_sname,
- gpt_types[i+idrows*2].gt_type, gpt_types[i+idrows*2].gt_sname);
+ gpt_types[i+idrows*2].gt_type,
+ gpt_types[i+idrows*2].gt_sname);
if ((i+idrows*3) < nitems(gpt_types)) {
printf(" %02X %s\n",
gpt_types[i+idrows*3].gt_type,
}
void
-PRT_make(const struct prt *prt, const uint64_t lba_self, const uint64_t lba_firstembr,
- struct dos_partition *dp)
+PRT_make(const struct prt *prt, const uint64_t lba_self,
+ const uint64_t lba_firstembr, struct dos_partition *dp)
{
struct chs start, end;
uint64_t off, t;