mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 10:22:06 -04:00
Merge branch '3321-libisc-so-undefined-reference-to-uv_os_getenv-on-stretch' into 'main'
Restore the implementation of uv_os_getenv() shim Closes #3321 See merge request isc-projects/bind9!6258
This commit is contained in:
commit
1d1395a916
1 changed files with 17 additions and 0 deletions
17
lib/isc/uv.c
17
lib/isc/uv.c
|
|
@ -20,6 +20,23 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue