1 --- device-mapper.1.02.09.orig/configure.in 2006-09-27 18:22:22.000000000 +0000
2 +++ device-mapper.1.02.09.klibc/configure.in 2006-09-27 18:22:22.000000000 +0000
7 -AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h sys/types.h unistd.h,,AC_MSG_ERROR(bailing out))
8 +AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h inttypes.h limits.h stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h sys/types.h unistd.h,,AC_MSG_ERROR(bailing out))
10 AC_CHECK_HEADERS(termios.h)
11 ################################################################################
12 --- device-mapper.1.02.09.orig/dmsetup/dmsetup.c 2006-08-10 20:53:21.000000000 +0000
13 +++ device-mapper.1.02.09.klibc/dmsetup/dmsetup.c 2006-09-27 18:22:58.000000000 +0000
21 #include <sys/param.h>
27 #ifdef HAVE_SYS_IOCTL_H
28 # include <sys/ioctl.h>
29 @@ -1547,9 +1548,11 @@
32 /* Symbol set default */
34 if (!strcmp(nl_langinfo(CODESET), "UTF-8"))
42 memset(&_values, 0, sizeof(_values));
44 namebase = strdup((*argv)[0]);
45 - base = basename(namebase);
46 + base = strrchr(namebase,'/');
47 + if (base != NULL) *base++ = 0;
48 + else base = namebase;
50 if (!strcmp(base, "devmap_name")) {
57 (void) setlocale(LC_ALL, "");
60 if (!_process_switches(&argc, &argv)) {
61 fprintf(stderr, "Couldn't process command line.\n");
62 --- device-mapper.1.02.09.orig/lib/ioctl/libdm-iface.c 2006-08-08 21:22:31.000000000 +0000
63 +++ device-mapper.1.02.09.klibc/lib/ioctl/libdm-iface.c 2006-09-27 18:22:22.000000000 +0000
69 + char nm[256], buf[300];
74 if (!(fl = fopen(file, "r"))) {
75 log_error("%s: fopen failed: %s", file, strerror(errno));
80 - if (fscanf(fl, "%d %255s\n", &num, &nm[0]) == 2) {
81 + /* Use fread+sscanf for klibc compatibility. */
85 + num = fread(&buf[size], sizeof(char), 1, fl);
88 + } while (num > 0 && buf[size - 1] != '\n');
90 + if (sscanf(buf, "%d %255s\n", &num, &nm[0]) == 2) {
91 if (!strcmp(name, nm)) {
96 dm_bit_set(_dm_bitset, num);
100 - } while (c != EOF && c != '\n');
103 + } while (size > 0);
107 --- device-mapper.1.02.09.orig/lib/libdm-file.c 2006-05-10 16:23:41.000000000 +0000
108 +++ device-mapper.1.02.09.klibc/lib/libdm-file.c 2006-09-27 18:22:22.000000000 +0000
111 #include "libdm-file.h"
113 -#include <sys/file.h>
118 +# include <sys/file.h>
120 +# include <malloc.h>
124 static int _create_dir_recursive(const char *dir)