aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fdisk_osf.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/fdisk_osf.c')
-rw-r--r--util-linux/fdisk_osf.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c
index e281ea5d9..30c42553b 100644
--- a/util-linux/fdisk_osf.c
+++ b/util-linux/fdisk_osf.c
@@ -502,6 +502,8 @@ xbsd_print_disklabel(int show_all)
int i, j;
if (show_all) {
+ static const int d_masks[] = { BSD_D_REMOVABLE, BSD_D_ECC, BSD_D_BADSECT };
+
#if defined(__alpha__)
printf("# %s:\n", disk_device);
#else
@@ -513,13 +515,8 @@ xbsd_print_disklabel(int show_all)
printf("type: %d\n", lp->d_type);
printf("disk: %.*s\n", (int) sizeof(lp->d_typename), lp->d_typename);
printf("label: %.*s\n", (int) sizeof(lp->d_packname), lp->d_packname);
- printf("flags:");
- if (lp->d_flags & BSD_D_REMOVABLE)
- printf(" removable");
- if (lp->d_flags & BSD_D_ECC)
- printf(" ecc");
- if (lp->d_flags & BSD_D_BADSECT)
- printf(" badsect");
+ printf("flags: ");
+ print_flags_separated(d_masks, "removable\0""ecc\0""badsect\0", lp->d_flags, " ");
bb_putchar('\n');
/* On various machines the fields of *lp are short/int/long */
/* In order to avoid problems, we cast them all to long. */