Changeset 44605


Ignore:
Timestamp:
2015-03-05T21:25:02+01:00 (3 years ago)
Author:
blogic
Message:

mtd: fix md5sum error checking

In mtd_verify(), the return value of md5sum() has been
interpreted as error if nonzero, while the function
returns number of processed bytes, which caused
mtd_verify() to always fail.

This patch fixes error checking to interpret only
negative values as errors.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/system/mtd/src/mtd.c

    r43512 r44605  
    338338                fprintf(stderr, "Verifying %s against %s ...\n", mtd, file); 
    339339 
    340         if (stat(file, &s) || md5sum(file, f_md5)) { 
     340        if (stat(file, &s) || md5sum(file, f_md5) < 0) { 
    341341                fprintf(stderr, "Failed to hash %s\n", file); 
    342342                return -1; 
Note: See TracChangeset for help on using the changeset viewer.