- remove strerrr() from debug messages (use %m) to make BLKID_DEBUG= output
thread-safe
+ - (!) don't use internally blkid_loff_t, rather use off_t, size_t, ssize_t,
+ stdint.h types and so on...
+
- add -<BE|LE> suffix to test images for native-endian filesystems (e.g. swap)
and add support for such functionality to tests/ts/blkid/low-probe
int enabled; /* boolean */
int flags; /* BLKID_<chain>_* */
int binary; /* boolean */
- int idx; /* index of the current prober */
+ int idx; /* index of the current prober (or -1) */
unsigned long *fltr; /* filter or NULL */
void *data; /* private chain data or NULL */
};
* Chain driver
*/
struct blkid_chaindrv {
- const int id; /* BLKID_CHAIN_* */
+ const size_t id; /* BLKID_CHAIN_* */
const char *name; /* name of chain (for debug purpose) */
const int dflt_flags; /* default chain flags */
const int dflt_enabled; /* default enabled boolean */
}
while (fgets(buf, sizeof(buf), f)) {
- unsigned int maj;
+ int maj;
char name[64];
- if (sscanf(buf, "%u %64[^\n ]", &maj, name) != 2)
+ if (sscanf(buf, "%d %64[^\n ]", &maj, name) != 2)
continue;
if (maj == major && strcmp(name, drvname) == 0) {
*/
int __blkid_probe_invert_filter(blkid_probe pr, int chain)
{
- int i;
+ size_t i;
struct blkid_chain *chn;
chn = &pr->chains[chain];
{
unsigned long *fltr;
struct blkid_chain *chn;
- int i;
+ size_t i;
fltr = blkid_probe_get_filter(pr, chain, TRUE);
if (!fltr)
* the start (chain->idx == -1)
*/
else if (rc == 1 && (chn->enabled == FALSE ||
- chn->idx + 1 == chn->driver->nidinfos ||
+ chn->idx + 1 == (int) chn->driver->nidinfos ||
chn->idx == -1)) {
- int idx = chn->driver->id + 1;
+ size_t idx = chn->driver->id + 1;
if (idx < BLKID_NCHAINS)
chn = pr->cur_chain = &pr->chains[idx];
/* converts DCE UUID (uuid[16]) to human readable string
* - the @len should be always 37 */
-void blkid_unparse_uuid(const unsigned char *uuid, char *str, size_t len)
-{
#ifdef HAVE_LIBUUID
+void blkid_unparse_uuid(const unsigned char *uuid, char *str,
+ size_t len __attribute__((__unused__)))
+{
uuid_unparse(uuid, str);
+}
#else
+void blkid_unparse_uuid(const unsigned char *uuid, char *str, size_t len)
+{
snprintf(str, len,
"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[6], uuid[7],
uuid[8], uuid[9],
uuid[10], uuid[11], uuid[12], uuid[13], uuid[14],uuid[15]);
-#endif
}
+#endif
/* Removes whitespace from the right-hand side of a string (trailing
chn = pr->cur_chain;
if (!chn || !chn->driver ||
- chn->idx < 0 || chn->idx >= chn->driver->nidinfos)
+ chn->idx < 0 || (size_t) chn->idx >= chn->driver->nidinfos)
return;
pr->wipe_size = size;