summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/include/os.h
diff options
context:
space:
mode:
authorRamon Fernandez <ramon@mongodb.com>2016-06-28 15:03:54 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-06-28 15:04:02 -0400
commite8dc6b98c1c91727f7def84f2fb4b57bf67ccc88 (patch)
treed42e295804d3c8247cbde5feed070c242b63dee0 /src/third_party/wiredtiger/src/include/os.h
parent30162fa8bbb9d7e7f7a789361aed7e046995f7b3 (diff)
downloadmongo-e8dc6b98c1c91727f7def84f2fb4b57bf67ccc88.tar.gz
Import wiredtiger-wiredtiger-2.8.0-219-gf4954f6.tar.gz from wiredtiger branch mongodb-3.2
ref: a6a64e9..f4954f6 SERVER-24580 Performance is poor when WiredTiger cache is full WT-2672 Handle system calls that don't set errno WT-2696 Missing log records with large updates WT-2702 Under high thread load, WiredTiger exceeds cache size WT-2708 split child-update race with reconciliation/eviction WT-2729 Focus eviction walks in largest trees
Diffstat (limited to 'src/third_party/wiredtiger/src/include/os.h')
-rw-r--r--src/third_party/wiredtiger/src/include/os.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/src/include/os.h b/src/third_party/wiredtiger/src/include/os.h
index 2ff41d39f46..44cceee6c40 100644
--- a/src/third_party/wiredtiger/src/include/os.h
+++ b/src/third_party/wiredtiger/src/include/os.h
@@ -17,15 +17,26 @@
#define WT_SYSCALL_RETRY(call, ret) do { \
int __retry; \
for (__retry = 0; __retry < 10; ++__retry) { \
- if ((call) == 0) { \
- (ret) = 0; \
- break; \
- } \
- switch ((ret) = __wt_errno()) { \
- case 0: \
- /* The call failed but didn't set errno. */ \
- (ret) = WT_ERROR; \
+ /* \
+ * A call returning 0 indicates success; any call where \
+ * 0 is not the only successful return must provide an \
+ * expression evaluating to 0 in all successful cases. \
+ */ \
+ if (((ret) = (call)) == 0) \
break; \
+ /* \
+ * The call's error was either returned by the call or \
+ * is in errno, and there are cases where it depends on \
+ * the software release as to which it is (for example, \
+ * posix_fadvise on FreeBSD and OS X). Failing calls \
+ * must either return a non-zero error value, or -1 if \
+ * the error value is in errno. (The WiredTiger errno \
+ * function returns WT_ERROR if errno is 0, which isn't \
+ * ideal but won't discard the failure.) \
+ */ \
+ if ((ret) == -1) \
+ (ret) = __wt_errno(); \
+ switch (ret) { \
case EAGAIN: \
case EBUSY: \
case EINTR: \