From e23d9cd027afe96e627cab54906db2df9d78606b Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 20 Dec 2022 15:55:13 +0100 Subject: context: delete unused label field It's not necessary to store the label in the context type, instead use the corresponding library function to get the current in-memory label container. The device label information is stored in-memory by libfdisk library when creating a context or assigning a device. Avoids possible incosistencies between libfdisk in-memory label and python-libfdisk context type label information. --- context.c | 2 -- fdisk.h | 1 - 2 files changed, 3 deletions(-) diff --git a/context.c b/context.c index 9c840f8..94a9fe7 100644 --- a/context.c +++ b/context.c @@ -33,7 +33,6 @@ static PyObject *Context_new(PyTypeObject *type, if (self) { self->cxt = NULL; - self->lb = NULL; self->tb = NULL; } @@ -96,7 +95,6 @@ static PyObject *Context_assign_device(ContextObject *self, PyObject *args, PyOb /* XXX: readonly */ fdisk_assign_device(self->cxt, fname, 1); - self->lb = fdisk_get_label(self->cxt, NULL); fdisk_get_partitions(self->cxt, &self->tb); Py_INCREF(Py_None); diff --git a/fdisk.h b/fdisk.h index 3324aad..5f41581 100644 --- a/fdisk.h +++ b/fdisk.h @@ -25,7 +25,6 @@ typedef struct { PyObject_HEAD struct fdisk_context *cxt; - struct fdisk_label *lb; struct fdisk_table *tb; } ContextObject; -- cgit v1.2.3-18-g5258