diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2022-12-20 15:55:13 +0100 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2022-12-20 16:18:31 +0100 |
commit | e23d9cd027afe96e627cab54906db2df9d78606b (patch) | |
tree | 87aa32fc8164e2b6acaa0cee8fb1a534627d5d9c | |
parent | a732758f2b67f325dd5ed45afb942445b1d5a7c8 (diff) |
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.
-rw-r--r-- | context.c | 2 | ||||
-rw-r--r-- | fdisk.h | 1 |
2 files changed, 0 insertions, 3 deletions
@@ -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); @@ -25,7 +25,6 @@ typedef struct { PyObject_HEAD struct fdisk_context *cxt; - struct fdisk_label *lb; struct fdisk_table *tb; } ContextObject; |