projects
/
oweals
/
fstools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b4b625
)
snapshot: md5sum return codes are not properly handled
author
John Crispin
<blogic@openwrt.org>
Wed, 27 Apr 2016 05:34:04 +0000
(07:34 +0200)
committer
John Crispin
<blogic@openwrt.org>
Wed, 27 Apr 2016 05:34:04 +0000
(07:34 +0200)
Signed-off-by: John Crispin <john@phrozen.org>
libfstools/snapshot.c
patch
|
blob
|
history
diff --git
a/libfstools/snapshot.c
b/libfstools/snapshot.c
index 936f2af21a76967051a903c29c60593306b68662..4870cf7a1955b7fd91d4b31e8dbcfd3f0e9d47fd 100644
(file)
--- a/
libfstools/snapshot.c
+++ b/
libfstools/snapshot.c
@@
-39,7
+39,7
@@
verify_file_hash(char *file, uint32_t *hash)
{
uint32_t md5[4];
- if (md5sum(file, md5)) {
+ if (md5sum(file, md5)
<= 0
) {
ULOG_ERR("failed to generate md5 sum\n");
return -1;
}
@@
-120,7
+120,7
@@
snapshot_write_file(struct volume *v, int block, char *file, uint32_t seq, uint3
int in = 0, len, offset;
int ret = -1;
- if (stat(file, &s) || md5sum(file, md5)) {
+ if (stat(file, &s) || md5sum(file, md5)
!= s.st_size
) {
ULOG_ERR("stat failed on %s\n", file);
goto out;
}