diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/os_posix/os_errno.c')
-rw-r--r-- | src/third_party/wiredtiger/src/os_posix/os_errno.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/os_posix/os_errno.c b/src/third_party/wiredtiger/src/os_posix/os_errno.c new file mode 100644 index 00000000000..9290f7d651f --- /dev/null +++ b/src/third_party/wiredtiger/src/os_posix/os_errno.c @@ -0,0 +1,22 @@ +/*- + * Copyright (c) 2008-2014 WiredTiger, Inc. + * All rights reserved. + * + * See the file LICENSE for redistribution information. + */ + +#include "wt_internal.h" + +/* + * __wt_errno -- + * Return errno, or WT_ERROR if errno not set. + */ +int +__wt_errno(void) +{ + /* + * Called when we know an error occurred, and we want the system + * error code, but there's some chance it's not set. + */ + return (errno == 0 ? WT_ERROR : errno); +} |