diff options
Diffstat (limited to 'src/os_posix/os_getenv.c')
-rw-r--r-- | src/os_posix/os_getenv.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/os_posix/os_getenv.c b/src/os_posix/os_getenv.c new file mode 100644 index 00000000000..83cf8a75770 --- /dev/null +++ b/src/os_posix/os_getenv.c @@ -0,0 +1,26 @@ +/*- + * Copyright (c) 2008-2014 WiredTiger, Inc. + * All rights reserved. + * + * See the file LICENSE for redistribution information. + */ + +#include "wt_internal.h" + +/* + * __wt_getenv -- + * Get a non-null environment variable + */ +int +__wt_getenv(WT_SESSION_IMPL *session, const char *variable, const char **env) +{ + const char *temp; + + *env = NULL; + + if (((temp = getenv(variable)) != NULL) && strlen(temp) > 0) { + return (__wt_strdup(session, temp, env)); + } + + return (WT_NOTFOUND); +} |