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;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- atexit(close_stdout);
+ close_stdout_atexit();
while ((c = getopt_long(argc, argv,
"abdglrsuvn:t:o:PS:hV", long_opts, NULL)) != -1) {
case 'h':
usage();
case 'V':
- printf(UTIL_LINUX_VERSION);
- return EXIT_SUCCESS;
+ print_version(EXIT_SUCCESS);
default:
errtryhelp(EXIT_FAILURE);
}
default:
abort();
}
- }
+ } else
+ rc = 1;
+
blkid_free_probe(pr);
}