From: Ondřej Surý Date: Wed, 4 May 2022 10:31:46 +0000 (+0200) Subject: Restore the implementation of uv_os_getenv() shim X-Git-Tag: v9.19.1~7^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0a102cc501975c50640daab07236c2b1af978ba;p=thirdparty%2Fbind9.git Restore the implementation of uv_os_getenv() shim Somewhere in the move from netmgr/uv-compat.h to uv.c, the uv_os_getenv() implementation was lost in the process. Restore the implementation, so we can support Debian stretch for couple more months. --- diff --git a/lib/isc/uv.c b/lib/isc/uv.c index af23012fca0..5f4b12dde68 100644 --- a/lib/isc/uv.c +++ b/lib/isc/uv.c @@ -20,6 +20,23 @@ #include #include +int +uv_os_getenv(const char *name, char *buffer, size_t *size) { + size_t len; + char *buf = getenv(name); + if (buf == NULL) { + return (UV_ENOENT); + } + len = strlen(buf) + 1; + if (len > *size) { + *size = len; + return (UV_ENOBUFS); + } + *size = len; + memmove(buffer, buf, len); + return (0); +} + #endif #if UV_VERSION_HEX < UV_VERSION(1, 27, 0)