1 diff -urN device-mapper.1.02.05.org/configure.in device-mapper.1.02.05/configure.in
2 --- device-mapper.1.02.05.org/configure.in 2006-04-19 18:38:56.000000000 +0200
3 +++ device-mapper.1.02.05/configure.in 2006-04-22 20:55:32.442643250 +0200
8 -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))
9 +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))
11 AC_CHECK_HEADERS(termios.h)
12 ################################################################################
13 diff -urN device-mapper.1.02.05.org/dmsetup/dmsetup.c device-mapper.1.02.05/dmsetup/dmsetup.c
14 --- device-mapper.1.02.05.org/dmsetup/dmsetup.c 2006-04-06 18:20:40.000000000 +0200
15 +++ device-mapper.1.02.05/dmsetup/dmsetup.c 2006-04-22 20:55:57.180189250 +0200
23 #include <sys/param.h>
24 @@ -1398,9 +1397,11 @@
27 /* Symbol set default */
29 if (!strcmp(nl_langinfo(CODESET), "UTF-8"))
37 memset(&_values, 0, sizeof(_values));
39 namebase = strdup((*argv)[0]);
40 - base = basename(namebase);
41 + base = strrchr(namebase,'/');
42 + if (base != NULL) *base++ = 0;
43 + else base = namebase;
45 if (!strcmp(base, "devmap_name")) {
52 (void) setlocale(LC_ALL, "");
55 if (!_process_switches(&argc, &argv)) {
56 fprintf(stderr, "Couldn't process command line.\n");
57 diff -urN device-mapper.1.02.05.org/lib/ioctl/libdm-iface.c device-mapper.1.02.05/lib/ioctl/libdm-iface.c
58 --- device-mapper.1.02.05.org/lib/ioctl/libdm-iface.c 2006-04-03 17:56:02.000000000 +0200
59 +++ device-mapper.1.02.05/lib/ioctl/libdm-iface.c 2006-04-22 20:55:32.442643250 +0200
65 + char nm[256], buf[300];
70 if (!(fl = fopen(file, "r"))) {
71 log_error("%s: fopen failed: %s", file, strerror(errno));
76 - if (fscanf(fl, "%d %255s\n", &num, &nm[0]) == 2) {
77 + /* Use fread+sscanf for klibc compatibility. */
81 + num = fread(&buf[size], sizeof(char), 1, fl);
84 + } while (num > 0 && buf[size - 1] != '\n');
86 + if (sscanf(buf, "%d %255s\n", &num, &nm[0]) == 2) {
87 if (!strcmp(name, nm)) {
92 dm_bit_set(_dm_bitset, num);
96 - } while (c != EOF && c != '\n');
103 diff -urN device-mapper.1.02.05.org/lib/libdm-file.c device-mapper.1.02.05/lib/libdm-file.c
104 --- device-mapper.1.02.05.org/lib/libdm-file.c 2006-01-31 15:50:37.000000000 +0100
105 +++ device-mapper.1.02.05/lib/libdm-file.c 2006-04-22 20:55:32.446643500 +0200
108 #include "libdm-file.h"
110 -#include <sys/file.h>
115 +# include <sys/file.h>
117 +# include <malloc.h>
121 static int _create_dir_recursive(const char *dir)