projects
/
project
/
fstools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
match full mtd partition names
[project/fstools.git]
/
libfstools
/
mtd.c
diff --git
a/libfstools/mtd.c
b/libfstools/mtd.c
index
60326fe
..
b9daabc
100644
(file)
--- a/
libfstools/mtd.c
+++ b/
libfstools/mtd.c
@@
-130,7
+130,9
@@
static char* mtd_find_index(char *name)
return index;
while (!index && fgets(line, sizeof(line), fp)) {
return index;
while (!index && fgets(line, sizeof(line), fp)) {
- if (strstr(line, name)) {
+ char *ret;
+
+ if ((ret = strstr(line, name)) && (ret[strlen(name)] == '"')) {
char *eol = strstr(line, ":");
if (!eol)
char *eol = strstr(line, ":");
if (!eol)
@@
-170,6
+172,11
@@
static int mtd_volume_find(struct volume *v, char *name)
snprintf(buffer, sizeof(buffer), "/dev/mtd%s", idx);
p->chr = strdup(buffer);
snprintf(buffer, sizeof(buffer), "/dev/mtd%s", idx);
p->chr = strdup(buffer);
+ if (mtd_volume_load(v)) {
+ fprintf(stderr, "reading %s failed\n", v->name);
+ return -1;
+ }
+
return 0;
}
return 0;
}
@@
-192,7
+199,7
@@
static int mtd_volume_identify(struct volume *v)
return -1;
}
return -1;
}
- if (deadc0de ==
0x4f575254
)
+ if (deadc0de ==
__be32_to_cpu(0x4f575254)
)
return FS_SNAPSHOT;
deadc0de = __be32_to_cpu(deadc0de);
return FS_SNAPSHOT;
deadc0de = __be32_to_cpu(deadc0de);