Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/efibootmgr/efibootmgr.c
Show First 20 Lines • Show All 1,028 Lines • ▼ Show 20 Lines | report_esp_device(bool do_dp, bool do_unix) | ||||
edp = (efidp)walker; | edp = (efidp)walker; | ||||
if (walker > ep) | if (walker > ep) | ||||
errx(1, "malformed boot variable %s", name); | errx(1, "malformed boot variable %s", name); | ||||
if (do_dp) { | if (do_dp) { | ||||
efidp_format_device_path_node(buf, sizeof(buf), dp); | efidp_format_device_path_node(buf, sizeof(buf), dp); | ||||
printf("%s\n", buf); | printf("%s\n", buf); | ||||
exit(0); | exit(0); | ||||
} | } | ||||
if (efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath) < 0) | if (efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath) != 0) | ||||
errx(1, "Can't convert to unix path"); | errx(1, "Can't convert to unix path"); | ||||
if (do_unix) { | if (do_unix) { | ||||
if (abspath == NULL) | if (abspath == NULL) | ||||
errx(1, "Can't find where %s:%s is mounted", | errx(1, "Can't find where %s:%s is mounted", | ||||
dev, relpath); | dev, relpath); | ||||
abspath[strlen(abspath) - strlen(relpath) - 1] = '\0'; | abspath[strlen(abspath) - strlen(relpath) - 1] = '\0'; | ||||
printf("%s\n", abspath); | printf("%s\n", abspath); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |