summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2018-05-30 10:47:09 +0200
committerKarel Zak2018-06-21 13:19:28 +0200
commit61bc5fd1569810223b704300b3cdf8b4f476ff67 (patch)
tree99fdaa5d8466a2cefb199b8d8205825f3d45f8b9 /disk-utils
parentresizepart: use new ul_path_* API (diff)
downloadkernel-qcow2-util-linux-61bc5fd1569810223b704300b3cdf8b4f476ff67.tar.gz
kernel-qcow2-util-linux-61bc5fd1569810223b704300b3cdf8b4f476ff67.tar.xz
kernel-qcow2-util-linux-61bc5fd1569810223b704300b3cdf8b4f476ff67.zip
partx: use new ul_path_* API
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/partx.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index f895b9be3..e10efa96a 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;