From ea601b75e29faaeba1eab15fce794e20cdcb746b Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 5 May 2004 18:15:47 +0000 Subject: [PATCH] Internal-only metadata flag support. --- WHATS_NEW | 2 ++ lib/format_text/flags.c | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 38a2805e5..425159a45 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,7 @@ Version 2.00.16 - ============================= + Internal-only metadata flag support. + Basic checking for presence of device-mapper targets. Separate out polldaemon. Revise internal locking semantics. Move find_pv_by_name to library. diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c index 1a9bbb394..16d413c33 100644 --- a/lib/format_text/flags.c +++ b/lib/format_text/flags.c @@ -93,19 +93,21 @@ int print_flags(uint32_t status, int type, char *buffer, size_t size) for (f = 0; flags[f].mask; f++) { if (status & flags[f].mask) { + status &= ~flags[f].mask; + + /* Internal-only flag? */ + if (!flags[f].description) + continue; + if (!first) { if (!emit_to_buffer(&buffer, &size, ", ")) return 0; - } else first = 0; - - if (flags[f].description && - !emit_to_buffer(&buffer, &size, "\"%s\"", - flags[f].description)) + + if (!emit_to_buffer(&buffer, &size, "\"%s\"", + flags[f].description)) return 0; - - status &= ~flags[f].mask; } }