diff options
author | Karel Zak | 2014-08-28 12:37:46 +0200 |
---|---|---|
committer | Karel Zak | 2014-08-28 12:37:46 +0200 |
commit | c1ba5863954c30079ea5cbfb964f982a13514f5b (patch) | |
tree | 6eff374a6e987f101b54c89fcb6bb4bf530ebf90 /libfdisk/src/parttype.c | |
parent | libfdisk: (dos) fix typo (diff) | |
download | kernel-qcow2-util-linux-c1ba5863954c30079ea5cbfb964f982a13514f5b.tar.gz kernel-qcow2-util-linux-c1ba5863954c30079ea5cbfb964f982a13514f5b.tar.xz kernel-qcow2-util-linux-c1ba5863954c30079ea5cbfb964f982a13514f5b.zip |
libfdisk: extend dump parsing function
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/parttype.c')
-rw-r--r-- | libfdisk/src/parttype.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libfdisk/src/parttype.c b/libfdisk/src/parttype.c index caf205a84..bb25cc6dd 100644 --- a/libfdisk/src/parttype.c +++ b/libfdisk/src/parttype.c @@ -161,7 +161,8 @@ struct fdisk_parttype *fdisk_label_parse_parttype( if (!lb->nparttypes) return NULL; - DBG(LABEL, ul_debugobj(lb, "parsing '%s' partition type", str)); + DBG(LABEL, ul_debugobj(lb, "parsing '%s' (%s) partition type", + str, lb->name)); types = lb->parttypes; @@ -234,5 +235,15 @@ const char *fdisk_parttype_get_name(const struct fdisk_parttype *t) return t->name; } - - +/** + * fdisk_parttype_is_unknown: + * @t: type + * + * Checks for example result from fdisk_label_parse_parttype(). + * + * Returns: 1 is type is "unknonw" or 0. + */ +int fdisk_parttype_is_unknown(const struct fdisk_parttype *t) +{ + return t && (t->flags & FDISK_PARTTYPE_UNKNOWN) ? 1 : 0; +} |