summaryrefslogtreecommitdiff
path: root/src/conn/api_strerror.c
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2017-06-27 12:01:10 +1000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-06-27 12:01:10 +1000
commit95d911ab246e444192f34dc395652dba2653dd3c (patch)
tree8e7c4692125a841a486607ccfe26e8499bc4c398 /src/conn/api_strerror.c
parent19cd4d9be2c0fd980c00bb04bc949970002f5cb2 (diff)
parentd139a5d5be1d7ba94130502b379a61a809e66272 (diff)
downloadmongo-2.9.3.tar.gz
Merge branch 'mongodb-3.6'2.9.3
Diffstat (limited to 'src/conn/api_strerror.c')
-rw-r--r--src/conn/api_strerror.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/conn/api_strerror.c b/src/conn/api_strerror.c
index edb11957556..63f982deb07 100644
--- a/src/conn/api_strerror.c
+++ b/src/conn/api_strerror.c
@@ -18,8 +18,6 @@
const char *
__wt_wiredtiger_error(int error)
{
- const char *p;
-
/*
* Check for WiredTiger specific errors.
*/
@@ -42,14 +40,20 @@ __wt_wiredtiger_error(int error)
return ("WT_CACHE_FULL: operation would overflow cache");
}
+ /* Windows strerror doesn't support ENOTSUP. */
+ if (error == ENOTSUP)
+ return ("Operation not supported");
+
/*
- * POSIX errors are non-negative integers; check for 0 explicitly incase
- * the underlying strerror doesn't handle 0, some historically didn't.
+ * Check for 0 in case the underlying strerror doesn't handle it, some
+ * historically didn't.
*/
if (error == 0)
return ("Successful return: 0");
- if (error > 0 && (p = strerror(error)) != NULL)
- return (p);
+
+ /* POSIX errors are non-negative integers. */
+ if (error > 0)
+ return (strerror(error));
return (NULL);
}