aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libfsimage
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-04-15 12:24:16 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-04-15 12:24:16 +0100
commita5913cc17ca9070625d6650ddc97b9f08bf455f3 (patch)
treec46731e7c410631fa496bee771aefdfa281cec39 /tools/libfsimage
parent0e697bad53d50888b82c2fb1b024709244a52b7c (diff)
downloadxen-a5913cc17ca9070625d6650ddc97b9f08bf455f3.tar.gz
xen-a5913cc17ca9070625d6650ddc97b9f08bf455f3.tar.bz2
xen-a5913cc17ca9070625d6650ddc97b9f08bf455f3.zip
libfsimage: zfs build fix for NetBSD
uchar_t is not defined because both FSYS_ZFS and FSIMAGE are defined at build time. Also fix warnings with ctype. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools/libfsimage')
-rw-r--r--tools/libfsimage/zfs/fsys_zfs.c16
-rw-r--r--tools/libfsimage/zfs/zfs_lzjb.c10
2 files changed, 13 insertions, 13 deletions
diff --git a/tools/libfsimage/zfs/fsys_zfs.c b/tools/libfsimage/zfs/fsys_zfs.c
index 6b4b183087..863232b188 100644
--- a/tools/libfsimage/zfs/fsys_zfs.c
+++ b/tools/libfsimage/zfs/fsys_zfs.c
@@ -80,8 +80,8 @@ static int zio_read_data(blkptr_t *bp, void *buf, char *stack);
static int
zfs_bcmp(const void *s1, const void *s2, size_t n)
{
- const uchar_t *ps1 = s1;
- const uchar_t *ps2 = s2;
+ const uint8_t *ps1 = s1;
+ const uint8_t *ps2 = s2;
if (s1 != s2 && n != 0) {
do {
@@ -802,11 +802,11 @@ dnode_get_path(dnode_phys_t *mdn, char *path, dnode_phys_t *dn,
while (*path == '/')
path++;
- while (*path && !isspace(*path)) {
+ while (*path && !isspace((uint8_t)*path)) {
/* get the next component name */
cname = path;
- while (*path && !isspace(*path) && *path != '/')
+ while (*path && !isspace((uint8_t)*path) && *path != '/')
path++;
ch = *path;
*path = 0; /* ensure null termination */
@@ -914,23 +914,23 @@ get_objset_mdn(dnode_phys_t *mosmdn, char *fsname, uint64_t *obj,
}
/* take out the pool name */
- while (*fsname && !isspace(*fsname) && *fsname != '/')
+ while (*fsname && !isspace((uint8_t)*fsname) && *fsname != '/')
fsname++;
- while (*fsname && !isspace(*fsname)) {
+ while (*fsname && !isspace((uint8_t)*fsname)) {
uint64_t childobj;
while (*fsname == '/')
fsname++;
cname = fsname;
- while (*fsname && !isspace(*fsname) && *fsname != '/')
+ while (*fsname && !isspace((uint8_t)*fsname) && *fsname != '/')
fsname++;
ch = *fsname;
*fsname = 0;
snapname = cname;
- while (*snapname && !isspace(*snapname) && *snapname != '@')
+ while (*snapname && !isspace((uint8_t)*snapname) && *snapname != '@')
snapname++;
if (*snapname == '@') {
issnapshot = 1;
diff --git a/tools/libfsimage/zfs/zfs_lzjb.c b/tools/libfsimage/zfs/zfs_lzjb.c
index ee41f8e402..c617362de3 100644
--- a/tools/libfsimage/zfs/zfs_lzjb.c
+++ b/tools/libfsimage/zfs/zfs_lzjb.c
@@ -34,10 +34,10 @@
int
lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len)
{
- uchar_t *src = s_start;
- uchar_t *dst = d_start;
- uchar_t *d_end = (uchar_t *)d_start + d_len;
- uchar_t *cpy, copymap = '\0';
+ uint8_t *src = s_start;
+ uint8_t *dst = d_start;
+ uint8_t *d_end = (uint8_t *)d_start + d_len;
+ uint8_t *cpy, copymap = '\0';
int copymask = 1 << (NBBY - 1);
while (dst < d_end) {
@@ -49,7 +49,7 @@ lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len)
int mlen = (src[0] >> (NBBY - MATCH_BITS)) + MATCH_MIN;
int offset = ((src[0] << NBBY) | src[1]) & OFFSET_MASK;
src += 2;
- if ((cpy = dst - offset) < (uchar_t *)d_start)
+ if ((cpy = dst - offset) < (uint8_t *)d_start)
return (-1);
while (--mlen >= 0 && dst < d_end)
*dst++ = *cpy++;