pkgsrc/devel/librfuncs/patches/patch-aa
drochner b1d04b2162 While getenv_r() is nonstandard, the version now in NetBSD-current
returns -1 on error and sets errno.
So we need to do the same.
bump PKGREVISION
2006-03-01 15:58:03 +00:00

24 lines
709 B
Text

$NetBSD: patch-aa,v 1.1 2006/03/01 15:58:03 drochner Exp $
--- src/getenv_r.c.orig 2006-03-01 16:06:43.000000000 +0100
+++ src/getenv_r.c
@@ -39,7 +39,8 @@ int getenv_r(const char *name, char *get
if (envList == NULL)
{
/* The string name was not found in the environment. */
- retVal = ENOENT;
+ errno = ENOENT;
+ retVal = -1;
}
else
{
@@ -50,7 +51,8 @@ int getenv_r(const char *name, char *get
Insufficient storage was supplied via getenvbuf and buflen to
contain the value for the specified name.
*/
- retVal = ERANGE;
+ errno = ERANGE;
+ retVal = -1;
}
else
{