]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: cleanup fdisk_get_partition_type() returns
authorKarel Zak <kzak@redhat.com>
Mon, 21 Jan 2013 11:50:25 +0000 (12:50 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Mar 2013 11:47:31 +0000 (12:47 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/label.c

index cd2b38cc782b55bfe7c4e1e2249d2e9d2df0d98e..502df69b44006f940a14d26ce2a6fcad612c4811 100644 (file)
@@ -206,8 +206,10 @@ struct fdisk_parttype *fdisk_get_partition_type(struct fdisk_context *cxt, int p
 int fdisk_set_partition_type(struct fdisk_context *cxt, int partnum,
                             struct fdisk_parttype *t)
 {
-       if (!cxt || !cxt->label || !cxt->label->op->part_set_type)
+       if (!cxt || !cxt->label)
                return -EINVAL;
+       if (!cxt->label->op->part_set_type)
+               return -ENOSYS;
 
        DBG(LABEL, dbgprint("partition: %d: set type", partnum));
        return cxt->label->op->part_set_type(cxt, cxt->label, partnum, t);