diff options
author | Karel Zak | 2012-12-11 15:08:06 +0100 |
---|---|---|
committer | Karel Zak | 2013-03-11 12:47:29 +0100 |
commit | 852ce62b424b13b7838afc497e59bdadaa84938e (patch) | |
tree | 296353d9d131ba2b00f913f0136ce8a74b3d98a5 /libfdisk/src/context.c | |
parent | libfdisk: add fdisk_new_context(), reuse context (diff) | |
download | kernel-qcow2-util-linux-852ce62b424b13b7838afc497e59bdadaa84938e.tar.gz kernel-qcow2-util-linux-852ce62b424b13b7838afc497e59bdadaa84938e.tar.xz kernel-qcow2-util-linux-852ce62b424b13b7838afc497e59bdadaa84938e.zip |
libfdisk: kill dos_compatible_flag global variable
... move the variable to label private struct.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/context.c')
-rw-r--r-- | libfdisk/src/context.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c index b2929f351..9801b51f2 100644 --- a/libfdisk/src/context.c +++ b/libfdisk/src/context.c @@ -36,12 +36,18 @@ struct fdisk_context *fdisk_new_context(void) return cxt; } +/* + * Returns the current label if no name specified. + */ struct fdisk_label *fdisk_context_get_label(struct fdisk_context *cxt, const char *name) { size_t i; assert(cxt); + if (!name) + return cxt->label; + for (i = 0; i < cxt->nlabels; i++) if (strcmp(cxt->labels[i]->name, name) == 0) return cxt->labels[i]; |