SOURCES (AC-branch): device-mapper-klibc.patch - merge from HEAD
aredridel
aredridel at pld-linux.org
Tue Apr 1 03:33:43 CEST 2008
Author: aredridel Date: Tue Apr 1 01:33:43 2008 GMT
Module: SOURCES Tag: AC-branch
---- Log message:
- merge from HEAD
---- Files affected:
SOURCES:
device-mapper-klibc.patch (1.1 -> 1.1.2.1)
---- Diffs:
================================================================
Index: SOURCES/device-mapper-klibc.patch
diff -u SOURCES/device-mapper-klibc.patch:1.1 SOURCES/device-mapper-klibc.patch:1.1.2.1
--- SOURCES/device-mapper-klibc.patch:1.1 Sun Jul 31 19:52:18 2005
+++ SOURCES/device-mapper-klibc.patch Tue Apr 1 03:33:37 2008
@@ -1,19 +1,17 @@
-diff -durN -x '*~' device-mapper.1.01.03.orig/configure.in device-mapper.1.01.03/configure.in
---- device-mapper.1.01.03.orig/configure.in 2005-06-13 16:07:29.000000000 +0200
-+++ device-mapper.1.01.03/configure.in 2005-07-31 18:58:27.000000000 +0200
-@@ -62,7 +62,7 @@
+--- device-mapper.1.02.09.orig/configure.in 2006-09-27 18:22:22.000000000 +0000
++++ device-mapper.1.02.09.klibc/configure.in 2006-09-27 18:22:22.000000000 +0000
+@@ -69,7 +69,7 @@
AC_HEADER_STDC
AC_HEADER_TIME
-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))
+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))
+ AC_CHECK_HEADERS(termios.h)
################################################################################
- dnl -- Checks for typedefs, structures, and compiler characteristics.
-diff -durN -x '*~' device-mapper.1.01.03.orig/dmsetup/dmsetup.c device-mapper.1.01.03/dmsetup/dmsetup.c
---- device-mapper.1.01.03.orig/dmsetup/dmsetup.c 2005-05-16 22:46:46.000000000 +0200
-+++ device-mapper.1.01.03/dmsetup/dmsetup.c 2005-07-31 18:58:01.000000000 +0200
-@@ -26,7 +26,6 @@
+--- device-mapper.1.02.09.orig/dmsetup/dmsetup.c 2006-08-10 20:53:21.000000000 +0000
++++ device-mapper.1.02.09.klibc/dmsetup/dmsetup.c 2006-09-27 18:22:58.000000000 +0000
+@@ -31,12 +31,13 @@
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
@@ -21,7 +19,26 @@
#include <sys/wait.h>
#include <unistd.h>
#include <sys/param.h>
-@@ -1051,7 +1050,9 @@
++#ifndef __KLIBC__
+ #include <locale.h>
+ #include <langinfo.h>
++#endif
+
+ #ifdef HAVE_SYS_IOCTL_H
+ # include <sys/ioctl.h>
+@@ -1547,9 +1548,11 @@
+ int len;
+
+ /* Symbol set default */
++#ifndef __KLIBC__
+ if (!strcmp(nl_langinfo(CODESET), "UTF-8"))
+ _tsym = &_tsym_utf;
+ else
++#endif
+ _tsym = &_tsym_ascii;
+
+ /* Default */
+@@ -1647,7 +1650,9 @@
memset(&_values, 0, sizeof(_values));
namebase = strdup((*argv)[0]);
@@ -32,25 +49,35 @@
if (!strcmp(base, "devmap_name")) {
free(namebase);
-diff -durN -x '*~' device-mapper.1.01.03.orig/lib/ioctl/libdm-iface.c device-mapper.1.01.03/lib/ioctl/libdm-iface.c
---- device-mapper.1.01.03.orig/lib/ioctl/libdm-iface.c 2005-07-31 18:02:15.000000000 +0200
-+++ device-mapper.1.01.03/lib/ioctl/libdm-iface.c 2005-07-31 18:58:01.000000000 +0200
-@@ -122,24 +122,30 @@
+@@ -1783,7 +1788,9 @@
+ struct command *c;
+ int r = 1;
+
++#ifndef __KLIBC__
+ (void) setlocale(LC_ALL, "");
++#endif
+
+ if (!_process_switches(&argc, &argv)) {
+ fprintf(stderr, "Couldn't process command line.\n");
+--- device-mapper.1.02.22/lib/ioctl/libdm-iface.c.orig 2007-08-21 18:26:07.000000000 +0200
++++ device-mapper.1.02.22/lib/ioctl/libdm-iface.c 2007-09-09 23:59:33.337996036 +0200
+@@ -134,17 +134,25 @@
uint32_t *number)
{
FILE *fl;
- char nm[256];
-- int c;
+ char nm[256], buf[300];
-+ int num, size;
+ int c;
+- uint32_t num;
++ uint32_t num, size;
if (!(fl = fopen(file, "r"))) {
- log_error("%s: fopen failed: %s", file, strerror(errno));
+ log_sys_error("fopen", file);
return 0;
}
- while (!feof(fl)) {
-- if (fscanf(fl, "%d %255s\n", number, &nm[0]) == 2) {
+- if (fscanf(fl, "%d %255s\n", &num, &nm[0]) == 2) {
+ /* Use fread+sscanf for klibc compatibility. */
+ do {
+ size = 0;
@@ -60,38 +87,53 @@
+ size++;
+ } while (num > 0 && buf[size - 1] != '\n');
+ buf[size] = '\0';
-+ if (sscanf(buf, "%d %255s\n", number, &nm[0]) == 2) {
++ if (sscanf(buf, "%d %255s\n", &num, &nm[0]) == 2) {
if (!strcmp(name, nm)) {
- fclose(fl);
- return 1;
+ if (number) {
+ *number = num;
+@@ -154,10 +162,9 @@
+ }
+ dm_bit_set(_dm_bitset, num);
}
- } else do {
- c = fgetc(fl);
- } while (c != EOF && c != '\n');
- }
-+ }
-+ } while (num > 0);
- fclose(fl);
-
- log_error("%s: No entry for %s found", file, name);
-diff -durN -x '*~' device-mapper.1.01.03.orig/lib/libdm-file.c device-mapper.1.01.03/lib/libdm-file.c
---- device-mapper.1.01.03.orig/lib/libdm-file.c 2005-01-27 17:16:54.000000000 +0100
-+++ device-mapper.1.01.03/lib/libdm-file.c 2005-07-31 18:58:01.000000000 +0200
-@@ -16,12 +16,14 @@
++ }
++ } while (size > 0);
++
+ if (fclose(fl))
+ log_sys_error("fclose", file);
+
+--- device-mapper.1.02.22/lib/libdm-file.c.orig 2007-08-21 18:26:06.000000000 +0200
++++ device-mapper.1.02.22/lib/libdm-file.c 2007-09-10 00:20:00.475926641 +0200
+@@ -15,10 +15,16 @@
+
#include "lib.h"
- #include "libdm-file.h"
-#include <sys/file.h>
#include <fcntl.h>
#include <dirent.h>
--#ifdef linux
--# include <malloc.h>
+#ifndef __KLIBC__
+# include <sys/file.h>
+# ifdef linux
+# include <malloc.h>
+# endif
- #endif
-
++#endif
++
static int _create_dir_recursive(const char *dir)
+ {
+ char *orig, *s;
+@@ -73,7 +79,11 @@
+
+ int dm_fclose(FILE *stream)
+ {
++#ifdef __KLIBC__
++ int prev_fail = 0;
++#else
+ int prev_fail = ferror(stream);
++#endif
+ int fclose_fail = fclose(stream);
+
+ /* If there was a previous failure, but fclose succeeded,
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/device-mapper-klibc.patch?r1=1.1&r2=1.1.2.1&f=u
More information about the pld-cvs-commit
mailing list