1 --- device-mapper/configure.in~ 2008-07-06 19:22:49.965050005 +0200
2 +++ device-mapper/configure.in 2008-07-06 19:26:11.998363857 +0200
5 ################################################################################
6 dnl -- Check for functions
7 -AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \
8 +AC_CHECK_FUNCS([gethostname memset mkdir rmdir munmap \
9 strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
10 uname], , [AC_MSG_ERROR(bailing out)])
12 --- device-mapper.1.02.09.orig/configure.in 2006-09-27 18:22:22.000000000 +0000
13 +++ device-mapper.1.02.09.klibc/configure.in 2006-09-27 18:22:22.000000000 +0000
18 -AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
19 +AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h inttypes.h limits.h \
20 stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
21 sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
22 AC_CHECK_HEADERS(termios.h sys/statvfs.h)
23 --- device-mapper.1.02.09.orig/dmsetup/dmsetup.c 2006-08-10 20:53:21.000000000 +0000
24 +++ device-mapper.1.02.09.klibc/dmsetup/dmsetup.c 2006-09-27 18:22:58.000000000 +0000
32 #include <sys/param.h>
38 #ifdef HAVE_SYS_IOCTL_H
39 # include <sys/ioctl.h>
40 @@ -1547,9 +1548,11 @@
43 /* Symbol set default */
45 if (!strcmp(nl_langinfo(CODESET), "UTF-8"))
53 memset(&_values, 0, sizeof(_values));
55 namebase = strdup((*argv)[0]);
56 - base = basename(namebase);
57 + base = strrchr(namebase,'/');
58 + if (base != NULL) *base++ = 0;
59 + else base = namebase;
61 if (!strcmp(base, "devmap_name")) {
68 (void) setlocale(LC_ALL, "");
71 if (!_process_switches(&argc, &argv)) {
72 fprintf(stderr, "Couldn't process command line.\n");
73 --- device-mapper.1.02.22/lib/ioctl/libdm-iface.c.orig 2007-08-21 18:26:07.000000000 +0200
74 +++ device-mapper.1.02.22/lib/ioctl/libdm-iface.c 2007-09-09 23:59:33.337996036 +0200
80 + char nm[256], buf[300];
85 if (!(fl = fopen(file, "r"))) {
86 log_sys_error("fopen", file);
91 - if (fscanf(fl, "%d %255s\n", &num, &nm[0]) == 2) {
92 + /* Use fread+sscanf for klibc compatibility. */
96 + num = fread(&buf[size], sizeof(char), 1, fl);
99 + } while (num > 0 && buf[size - 1] != '\n');
101 + if (sscanf(buf, "%d %255s\n", &num, &nm[0]) == 2) {
102 if (!strcmp(name, nm)) {
107 dm_bit_set(_dm_bitset, num);
111 - } while (c != EOF && c != '\n');
114 + } while (size > 0);
117 log_sys_error("fclose", file);
119 --- device-mapper.1.02.22/lib/libdm-file.c.orig 2007-08-21 18:26:06.000000000 +0200
120 +++ device-mapper.1.02.22/lib/libdm-file.c 2007-09-10 00:20:00.475926641 +0200
125 -#include <sys/file.h>
130 +# include <sys/file.h>
132 +# include <malloc.h>
136 static int _create_dir_recursive(const char *dir)
141 int dm_fclose(FILE *stream)
146 int prev_fail = ferror(stream);
148 int fclose_fail = fclose(stream);
150 /* If there was a previous failure, but fclose succeeded,