]>
Commit | Line | Data |
---|---|---|
a61b39d0 AM |
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 | |
c97ab21d | 4 | @@ -66,7 +66,7 @@ |
93de1115 JK |
5 | AC_HEADER_STDC |
6 | AC_HEADER_TIME | |
7 | ||
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)) | |
10 | ||
c97ab21d | 11 | AC_CHECK_HEADERS(termios.h) |
93de1115 | 12 | ################################################################################ |
d2a9d666 JB |
13 | --- device-mapper.1.02.09/dmsetup/dmsetup.c.orig 2006-08-10 22:53:21.000000000 +0200 |
14 | +++ device-mapper.1.02.09/dmsetup/dmsetup.c 2006-08-22 22:47:12.862554000 +0200 | |
15 | @@ -31,7 +31,6 @@ | |
93de1115 JK |
16 | #include <dirent.h> |
17 | #include <errno.h> | |
18 | #include <unistd.h> | |
19 | -#include <libgen.h> | |
20 | #include <sys/wait.h> | |
21 | #include <unistd.h> | |
22 | #include <sys/param.h> | |
d2a9d666 | 23 | @@ -1547,9 +1546,11 @@ |
a61b39d0 AM |
24 | int len; |
25 | ||
26 | /* Symbol set default */ | |
27 | +#ifndef __KLIBC__ | |
28 | if (!strcmp(nl_langinfo(CODESET), "UTF-8")) | |
29 | _tsym = &_tsym_utf; | |
30 | else | |
31 | +#endif | |
32 | _tsym = &_tsym_ascii; | |
33 | ||
34 | /* Default */ | |
d2a9d666 | 35 | @@ -1647,7 +1648,9 @@ |
93de1115 JK |
36 | memset(&_values, 0, sizeof(_values)); |
37 | ||
38 | namebase = strdup((*argv)[0]); | |
39 | - base = basename(namebase); | |
40 | + base = strrchr(namebase,'/'); | |
41 | + if (base != NULL) *base++ = 0; | |
42 | + else base = namebase; | |
43 | ||
44 | if (!strcmp(base, "devmap_name")) { | |
45 | free(namebase); | |
d2a9d666 | 46 | @@ -1783,7 +1786,9 @@ |
a61b39d0 AM |
47 | struct command *c; |
48 | int r = 1; | |
49 | ||
50 | +#ifndef __KLIBC__ | |
d2a9d666 | 51 | (void) setlocale(LC_ALL, ""); |
a61b39d0 AM |
52 | +#endif |
53 | ||
54 | if (!_process_switches(&argc, &argv)) { | |
55 | fprintf(stderr, "Couldn't process command line.\n"); | |
56 | diff -urN device-mapper.1.02.05.org/lib/ioctl/libdm-iface.c device-mapper.1.02.05/lib/ioctl/libdm-iface.c | |
c97ab21d | 57 | --- device-mapper.1.02.05.org/lib/ioctl/libdm-iface.c 2006-04-03 17:56:02.000000000 +0200 |
a61b39d0 | 58 | +++ device-mapper.1.02.05/lib/ioctl/libdm-iface.c 2006-04-22 20:55:32.442643250 +0200 |
c97ab21d | 59 | @@ -135,17 +135,25 @@ |
93de1115 JK |
60 | uint32_t *number) |
61 | { | |
62 | FILE *fl; | |
63 | - char nm[256]; | |
93de1115 | 64 | + char nm[256], buf[300]; |
c97ab21d AM |
65 | int c; |
66 | - uint32_t num; | |
67 | + uint32_t num, size; | |
93de1115 JK |
68 | |
69 | if (!(fl = fopen(file, "r"))) { | |
70 | log_error("%s: fopen failed: %s", file, strerror(errno)); | |
71 | return 0; | |
72 | } | |
73 | ||
74 | - while (!feof(fl)) { | |
c97ab21d | 75 | - if (fscanf(fl, "%d %255s\n", &num, &nm[0]) == 2) { |
93de1115 JK |
76 | + /* Use fread+sscanf for klibc compatibility. */ |
77 | + do { | |
78 | + size = 0; | |
79 | + do { | |
80 | + num = fread(&buf[size], sizeof(char), 1, fl); | |
81 | + if (num > 0) | |
82 | + size++; | |
83 | + } while (num > 0 && buf[size - 1] != '\n'); | |
84 | + buf[size] = '\0'; | |
35dd99f6 | 85 | + if (sscanf(buf, "%d %255s\n", &num, &nm[0]) == 2) { |
93de1115 | 86 | if (!strcmp(name, nm)) { |
c97ab21d AM |
87 | if (number) { |
88 | *number = num; | |
89 | @@ -154,10 +162,8 @@ | |
90 | } | |
91 | dm_bit_set(_dm_bitset, num); | |
93de1115 JK |
92 | } |
93 | - } else do { | |
94 | - c = fgetc(fl); | |
95 | - } while (c != EOF && c != '\n'); | |
96 | - } | |
97 | + } | |
35dd99f6 | 98 | + } while (size > 0); |
93de1115 JK |
99 | fclose(fl); |
100 | ||
c97ab21d | 101 | if (number) { |
a61b39d0 | 102 | diff -urN device-mapper.1.02.05.org/lib/libdm-file.c device-mapper.1.02.05/lib/libdm-file.c |
c97ab21d | 103 | --- device-mapper.1.02.05.org/lib/libdm-file.c 2006-01-31 15:50:37.000000000 +0100 |
a61b39d0 | 104 | +++ device-mapper.1.02.05/lib/libdm-file.c 2006-04-22 20:55:32.446643500 +0200 |
c97ab21d | 105 | @@ -16,10 +16,16 @@ |
93de1115 JK |
106 | #include "lib.h" |
107 | #include "libdm-file.h" | |
108 | ||
109 | -#include <sys/file.h> | |
110 | #include <fcntl.h> | |
111 | #include <dirent.h> | |
112 | ||
93de1115 JK |
113 | +#ifndef __KLIBC__ |
114 | +# include <sys/file.h> | |
115 | +# ifdef linux | |
116 | +# include <malloc.h> | |
117 | +# endif | |
c97ab21d AM |
118 | +#endif |
119 | + | |
93de1115 | 120 | static int _create_dir_recursive(const char *dir) |
c97ab21d AM |
121 | { |
122 | char *orig, *s; |