diff options
author | Luke Chen <luke.chen@mongodb.com> | 2020-08-11 16:45:52 +1000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-11 07:26:55 +0000 |
commit | 354959497599265c78f520a6a80fb378ed6932bd (patch) | |
tree | 4dc71e4b4db598fd312a00585d89952a7ec2835c /src/third_party/wiredtiger/examples/c | |
parent | 85d1de04863eea1d550aa540f41ae74cb3f6c80f (diff) | |
download | mongo-354959497599265c78f520a6a80fb378ed6932bd.tar.gz |
Import wiredtiger: 36194b4a0341d4b22349510c6a09ab82757f266c from branch mongodb-4.6
ref: 4bcef79f18..36194b4a03
for: 4.5.1
WT-6571 Lseek cannot use error_sys_check because it does not return an int
WT-6581 Fix class name in test_hs15
Diffstat (limited to 'src/third_party/wiredtiger/examples/c')
-rw-r--r-- | src/third_party/wiredtiger/examples/c/ex_backup_block.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/examples/c/ex_backup_block.c b/src/third_party/wiredtiger/examples/c/ex_backup_block.c index 24ec718af53..be21c76051d 100644 --- a/src/third_party/wiredtiger/examples/c/ex_backup_block.c +++ b/src/third_party/wiredtiger/examples/c/ex_backup_block.c @@ -387,9 +387,16 @@ take_incr_backup(WT_SESSION *session, int i) first = false; } - error_sys_check(lseek(rfd, (wt_off_t)offset, SEEK_SET)); + /* + * Don't use the system checker for lseek. The system check macro uses an int which + * is often 4 bytes and checks for any negative value. The offset returned from + * lseek is 8 bytes and we can have a false positive error check. + */ + if (lseek(rfd, (wt_off_t)offset, SEEK_SET) == -1) + testutil_die(errno, "lseek: read"); error_sys_check(rdsize = (size_t)read(rfd, tmp, (size_t)size)); - error_sys_check(lseek(wfd, (wt_off_t)offset, SEEK_SET)); + if (lseek(wfd, (wt_off_t)offset, SEEK_SET) == -1) + testutil_die(errno, "lseek: write"); /* Use the read size since we may have read less than the granularity. */ error_sys_check(write(wfd, tmp, rdsize)); } else { |