]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
partx: use new ul_path_* API
authorKarel Zak <kzak@redhat.com>
Wed, 30 May 2018 08:47:09 +0000 (10:47 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Jun 2018 11:19:28 +0000 (13:19 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/partx.c

index f895b9be31a077e28963f2cd3cae8fa3b73ffb51..e10efa96af64bdb567df86f5e9b0c07fb456faf7 100644 (file)
@@ -177,14 +177,15 @@ static int get_partno_from_device(char *partition, dev_t devno)
        assert(partition);
 
        if (devno) {
-               struct sysfs_cxt cxt;
+               struct path_cxt *pc;
                int rc;
 
-               if (sysfs_init(&cxt, devno, NULL))
+               pc = ul_new_sysfs_path(devno, NULL, NULL);
+               if (!pc)
                        goto err;
 
-               rc = sysfs_read_int(&cxt, "partition", &partno);
-               sysfs_deinit(&cxt);
+               rc = ul_path_read_s32(pc, &partno, "partition");
+               ul_unref_path(pc);
 
                if (rc == 0)
                        return partno;