summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-05-11 12:05:05 -0700
committerBrian Behlendorf <[email protected]>2015-05-11 12:15:41 -0700
commit3df293404a102398445fc013b67250073db9004e (patch)
treebaf02335a5ef6e5cf6aa0afdac599236635d6974 /lib
parentf9cab372917983805e14154df0720d21333326c3 (diff)
Fix type mismatch on 32-bit systems
The umem_alloc_aligned() function should not assume that a 'void *' type is 64-bit. It will not be on 32-bit platforms. Rather than complicating the ASSERT to handle this it is simply removed. Additionally, the '%lu' format specifier should not be assumed to imply a 64-bit value. Fix this by using the 'llu' format specifier which will always be atleast 64-bit and explicitly casing the variable to an u_longlong_t. This issue is handled the same way in many other parts of the code. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/libspl/include/umem.h2
-rw-r--r--lib/libzfs/libzfs_sendrecv.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/libspl/include/umem.h b/lib/libspl/include/umem.h
index b3ce6e710..b1c9cb7ff 100644
--- a/lib/libspl/include/umem.h
+++ b/lib/libspl/include/umem.h
@@ -109,8 +109,6 @@ umem_alloc_aligned(size_t size, size_t align, int flags)
return (NULL);
}
- ASSERT0(P2PHASE_TYPED(ptr, align, uint64_t));
-
return (ptr);
}
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index 70870f766..8911e0ed2 100644
--- a/lib/libzfs/libzfs_sendrecv.c
+++ b/lib/libzfs/libzfs_sendrecv.c
@@ -2179,7 +2179,8 @@ again:
needagain = B_TRUE;
else
progress = B_TRUE;
- sprintf(guidname, "%lu", thisguid);
+ sprintf(guidname, "%llu",
+ (u_longlong_t)thisguid);
nvlist_add_boolean(deleted, guidname);
continue;
}
@@ -2236,7 +2237,8 @@ again:
needagain = B_TRUE;
else
progress = B_TRUE;
- sprintf(guidname, "%lu", parent_fromsnap_guid);
+ sprintf(guidname, "%llu",
+ (u_longlong_t) parent_fromsnap_guid);
nvlist_add_boolean(deleted, guidname);
continue;
}
@@ -2269,7 +2271,8 @@ again:
if (stream_parent_fromsnap_guid != 0 &&
parent_fromsnap_guid != 0 &&
stream_parent_fromsnap_guid != parent_fromsnap_guid) {
- sprintf(guidname, "%lu", parent_fromsnap_guid);
+ sprintf(guidname, "%llu",
+ (u_longlong_t) parent_fromsnap_guid);
if (nvlist_exists(deleted, guidname)) {
progress = B_TRUE;
needagain = B_TRUE;