commit - fe48607a15ec17b295bde08490a3d333fc4af70f
commit + edb140afb51d44baf22a9adbd35c3a3f63b31a32
blob - 2063c35ffc295a9ed3a354b92eeca98e14752d52
blob + a5623a5d201da8892eeb8f47d5a769217c2a5c4b
--- diskinfo.c
+++ diskinfo.c
if (ioctl(dev, DIOCGDINFO, &dl) == -1)
err(1, "%s: ioctl(DIOCGDINFO)", __func__);
- printf("%s:", devname);
- if (!isduid(devname, OPENDEV_PART)) {
- printf("%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
+ printf("%s", devname);
+ const uint8_t duid_zero[8] = { 0, 0, 0, 0, 0, 0, 0, 0};
+ if (!isduid(devname, OPENDEV_PART) && (memcmp(dl.d_uid, duid_zero, sizeof(duid_zero)) != 0)) {
+ printf(":%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
dl.d_uid[0], dl.d_uid[1], dl.d_uid[2], dl.d_uid[3],
dl.d_uid[4], dl.d_uid[5], dl.d_uid[6], dl.d_uid[7]);
}