add drbl patch for partclone

Package-Manager: portage-2.2.0_alpha142
RepoMan-Options: --force
This commit is contained in:
Mario Fetka
2012-11-28 21:24:35 +01:00
parent 00fbf96e3a
commit 62673eaa52
5 changed files with 49 additions and 48 deletions

View File

@@ -1,37 +0,0 @@
--- reiser4progs-1.0.7/libreiser4/profile.c~ 2009-01-08 22:34:27.000000000 +0100
+++ reiser4progs-1.0.7/libreiser4/profile.c 2011-01-07 01:28:39.509867695 +0100
@@ -5,7 +5,7 @@
#include <reiser4/libreiser4.h>
-#include <misc/misc.h>
+#define INVAL_DIG (0x7fffffff)
/* All default plugin ids. This is used for getting plugin id if it cannot be
obtained by usual way (get from disk structures, etc.). All these may be
@@ -327,6 +327,25 @@
}
}
+#include <stdlib.h>
+#include <errno.h>
+/* Converts passed @sqtr into long long value. In the case of error, INVAL_DIG
+ will be returned. */
+static long long misc_str2long(const char *str, int base) {
+ char *error;
+ long long result = 0;
+
+ if (!str)
+ return INVAL_DIG;
+
+ result = strtol(str, &error, base);
+
+ if (errno == ERANGE || *error)
+ return INVAL_DIG;
+
+ return result;
+}
+
/* Overrides plugin id by @id found by @name. */
errno_t reiser4_profile_override(const char *slot, const char *name) {
reiser4_plug_t *plug;

View File

@@ -0,0 +1,30 @@
--- reiser4progs-1.0.7.orig/libreiser4/profile.c
+++ reiser4progs-1.0.7/libreiser4/profile.c
@@ -5,7 +5,8 @@
#include <reiser4/libreiser4.h>
-#include <misc/misc.h>
+#include <stdlib.h>
+#include <errno.h>
/* All default plugin ids. This is used for getting plugin id if it cannot be
obtained by usual way (get from disk structures, etc.). All these may be
@@ -332,6 +333,7 @@
reiser4_plug_t *plug;
long long int val;
uint8_t i;
+ char *error;
aal_assert("umka-924", slot != NULL);
aal_assert("umka-923", name != NULL);
@@ -354,7 +356,8 @@
}
if (defprof.pid[i].id.type == PARAM_PLUG_TYPE) {
- if ((val = misc_str2long((char *)name, 10)) == INVAL_DIG) {
+ val = strtol((char *)name, &error, 10);
+ if (errno == ERANGE || *error) {
aal_error("Invalid value \"%s\" is provided for the "
"profile slot \"%s\".", (char *)name,
defprof.pid[i].name);