Displaying 1 result from an estimated 1 matches for "blkid_do_safeprobe".
2012 Feb 14
1
[PATCH RFC] blkid: start using libblkid directly instead
..._set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL |
+ BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE);
- /* Trim trailing \n if present. */
- size_t len = strlen (out);
- if (len > 0 && out[len-1] == '\n')
- out[len-1] = '\0';
+ rc = blkid_do_safeprobe (blkprobe);
+ if (!rc)
+ blkid_probe_lookup_value (blkprobe, tag, &data, NULL);
- return out; /* caller frees */
+done:
+ close (fd);
+ if (blkprobe)
+ blkid_free_probe (blkprobe);
+ return data ? strdup ((char *) data) : NULL;
}
char *
--
1.7.9