diff options
author | Jimmy Huang <jimmy.huang@linux.intel.com> | 2017-05-15 10:49:50 -0700 |
---|---|---|
committer | Geoff Gustafson <geoff@linux.intel.com> | 2017-05-15 10:49:50 -0700 |
commit | 370082bb3a063c42155abe15a453e4d0840eeef9 (patch) | |
tree | ff1e48666150e62eee890dcd8ee46d994c9d619b | |
parent | e24821c2f1133a76b28140cc98b491ecc76c60f0 (diff) |
[fs] Fix truncate check for wrong return value (#1139)
FS.truncate() will always fail since it doesn't check the wrong return
value from Zephyr
Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
-rw-r--r-- | src/zjs_fs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zjs_fs.c b/src/zjs_fs.c index ab2df1b..7d019dc 100644 --- a/src/zjs_fs.c +++ b/src/zjs_fs.c @@ -586,7 +586,7 @@ static ZJS_DECL_FUNC_ARGS(zjs_fs_truncate, uint8_t async) uint32_t length = jerry_get_number_value(argv[1]); - if (!fs_truncate(&fp, length)) { + if (fs_truncate(&fp, length) != 0) { return zjs_error("error calling fs_truncate()"); } |