diff options
author | Eric Andersen <andersen@codepoet.org> | 2006-01-30 17:30:22 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2006-01-30 17:30:22 +0000 |
commit | 76b24270d459f574a972467ff525ed7a793e8bdc (patch) | |
tree | 18dfc68ae459b003fc81ad570de58da63d66d993 | |
parent | f55289f4b994afa08444d9204c8ed5ebb036a4ee (diff) | |
download | busybox-w32-76b24270d459f574a972467ff525ed7a793e8bdc.tar.gz busybox-w32-76b24270d459f574a972467ff525ed7a793e8bdc.tar.bz2 busybox-w32-76b24270d459f574a972467ff525ed7a793e8bdc.zip |
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.
-rw-r--r-- | libbb/loop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libbb/loop.c b/libbb/loop.c index 09b2beaa7..81dfca4d1 100644 --- a/libbb/loop.c +++ b/libbb/loop.c | |||
@@ -60,7 +60,7 @@ char *query_loop(const char *device) | |||
60 | if ((fd = open(device, O_RDONLY)) < 0) return 0; | 60 | if ((fd = open(device, O_RDONLY)) < 0) return 0; |
61 | if (!ioctl(fd, BB_LOOP_GET_STATUS, &loopinfo)) | 61 | if (!ioctl(fd, BB_LOOP_GET_STATUS, &loopinfo)) |
62 | dev=bb_xasprintf("%ld %s", (long) loopinfo.lo_offset, | 62 | dev=bb_xasprintf("%ld %s", (long) loopinfo.lo_offset, |
63 | loopinfo.lo_file_name); | 63 | (char *)loopinfo.lo_file_name); |
64 | close(fd); | 64 | close(fd); |
65 | 65 | ||
66 | return dev; | 66 | return dev; |
@@ -114,7 +114,7 @@ int set_loop(char **device, const char *file, int offset) | |||
114 | /* If device free, claim it. */ | 114 | /* If device free, claim it. */ |
115 | if(rc && errno==ENXIO) { | 115 | if(rc && errno==ENXIO) { |
116 | memset(&loopinfo, 0, sizeof(loopinfo)); | 116 | memset(&loopinfo, 0, sizeof(loopinfo)); |
117 | safe_strncpy(loopinfo.lo_file_name, file, LO_NAME_SIZE); | 117 | safe_strncpy((char *)loopinfo.lo_file_name, file, LO_NAME_SIZE); |
118 | loopinfo.lo_offset = offset; | 118 | loopinfo.lo_offset = offset; |
119 | /* Associate free loop device with file. */ | 119 | /* Associate free loop device with file. */ |
120 | if(!ioctl(dfd, LOOP_SET_FD, ffd) && | 120 | if(!ioctl(dfd, LOOP_SET_FD, ffd) && |
@@ -125,7 +125,7 @@ int set_loop(char **device, const char *file, int offset) | |||
125 | file isn't pretty either. In general, mounting the same file twice | 125 | file isn't pretty either. In general, mounting the same file twice |
126 | without using losetup manually is problematic.) | 126 | without using losetup manually is problematic.) |
127 | */ | 127 | */ |
128 | } else if(strcmp(file,loopinfo.lo_file_name) | 128 | } else if(strcmp(file,(char *)loopinfo.lo_file_name) |
129 | || offset!=loopinfo.lo_offset) rc=-1; | 129 | || offset!=loopinfo.lo_offset) rc=-1; |
130 | close(dfd); | 130 | close(dfd); |
131 | try_again: | 131 | try_again: |