From: Karel Zak Date: Wed, 30 May 2018 08:47:09 +0000 (+0200) Subject: partx: use new ul_path_* API X-Git-Tag: v2.33-rc1~170 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61bc5fd1569810223b704300b3cdf8b4f476ff67;p=thirdparty%2Futil-linux.git partx: use new ul_path_* API Signed-off-by: Karel Zak --- diff --git a/disk-utils/partx.c b/disk-utils/partx.c index f895b9be31..e10efa96af 100644 --- a/disk-utils/partx.c +++ b/disk-utils/partx.c @@ -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;