aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-03-19 17:06:35 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-03-19 17:06:35 -0700
commit88516185bbf3daa3056d61156dafaafbccf711ea (patch)
tree937fd86f956838aa0d97988e00abdce5f11b039e
parent7d0a2354430174bb6d4d6c3f57c5d658dc35de6d (diff)
downloadklibc-88516185bbf3daa3056d61156dafaafbccf711ea.tar.gz
[klibc] losetup: fix pointer type warningsklibc-1.5.17
- For arguments which are text strings (and therefore passed to the str* functions) make them char, not unsigned char. - Make gcc happy by casting non-pointer arguments passed as pointers to ioctl(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--usr/utils/loop.h6
-rw-r--r--usr/utils/losetup.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/usr/utils/loop.h b/usr/utils/loop.h
index 9839f576baecc..9abc2874c510e 100644
--- a/usr/utils/loop.h
+++ b/usr/utils/loop.h
@@ -42,8 +42,8 @@ struct loop_info64 {
unsigned int lo_encrypt_type;
unsigned int lo_encrypt_key_size;
unsigned int lo_flags;
- unsigned char lo_file_name[LO_NAME_SIZE];
- unsigned char lo_crypt_name[LO_NAME_SIZE];
- unsigned char lo_encrypt_key[LO_KEY_SIZE];
+ char lo_file_name[LO_NAME_SIZE];
+ char lo_crypt_name[LO_NAME_SIZE];
+ char lo_encrypt_key[LO_KEY_SIZE];
unsigned long long lo_init[2];
};
diff --git a/usr/utils/losetup.c b/usr/utils/losetup.c
index e494183d205d7..1104fd348d8f4 100644
--- a/usr/utils/losetup.c
+++ b/usr/utils/losetup.c
@@ -290,7 +290,7 @@ int set_loop(const char *device, const char *file, unsigned long long offset,
loopinfo64.lo_encrypt_key_size = LO_KEY_SIZE;
}
- if (ioctl(fd, LOOP_SET_FD, ffd) < 0) {
+ if (ioctl(fd, LOOP_SET_FD, (void *)(size_t)ffd) < 0) {
perror("ioctl: LOOP_SET_FD");
return 1;
}