summaryrefslogtreecommitdiff
path: root/libbb/loop.c
diff options
context:
space:
mode:
authorEric Andersen2006-01-30 17:30:22 +0000
committerEric Andersen2006-01-30 17:30:22 +0000
commit76b24270d459f574a972467ff525ed7a793e8bdc (patch)
tree18dfc68ae459b003fc81ad570de58da63d66d993 /libbb/loop.c
parentf55289f4b994afa08444d9204c8ed5ebb036a4ee (diff)
downloadbusybox-76b24270d459f574a972467ff525ed7a793e8bdc.zip
busybox-76b24270d459f574a972467ff525ed7a793e8bdc.tar.gz
with 2.4 kernel headers, lo_file_name is char, but with 2.6
headers we get a u8 for lo_file_name, so always cast to (char *) when treating it as such.
Diffstat (limited to 'libbb/loop.c')
-rw-r--r--libbb/loop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libbb/loop.c b/libbb/loop.c
index 09b2bea..81dfca4 100644
--- a/libbb/loop.c
+++ b/libbb/loop.c
@@ -60,7 +60,7 @@ char *query_loop(const char *device)
if ((fd = open(device, O_RDONLY)) < 0) return 0;
if (!ioctl(fd, BB_LOOP_GET_STATUS, &loopinfo))
dev=bb_xasprintf("%ld %s", (long) loopinfo.lo_offset,
- loopinfo.lo_file_name);
+ (char *)loopinfo.lo_file_name);
close(fd);
return dev;
@@ -114,7 +114,7 @@ int set_loop(char **device, const char *file, int offset)
/* If device free, claim it. */
if(rc && errno==ENXIO) {
memset(&loopinfo, 0, sizeof(loopinfo));
- safe_strncpy(loopinfo.lo_file_name, file, LO_NAME_SIZE);
+ safe_strncpy((char *)loopinfo.lo_file_name, file, LO_NAME_SIZE);
loopinfo.lo_offset = offset;
/* Associate free loop device with file. */
if(!ioctl(dfd, LOOP_SET_FD, ffd) &&
@@ -125,7 +125,7 @@ int set_loop(char **device, const char *file, int offset)
file isn't pretty either. In general, mounting the same file twice
without using losetup manually is problematic.)
*/
- } else if(strcmp(file,loopinfo.lo_file_name)
+ } else if(strcmp(file,(char *)loopinfo.lo_file_name)
|| offset!=loopinfo.lo_offset) rc=-1;
close(dfd);
try_again: