aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/setenv.c20
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h2
2 files changed, 19 insertions, 3 deletions
diff --git a/sysdeps/generic/setenv.c b/sysdeps/generic/setenv.c
index 69bd992832..baae4c59b2 100644
--- a/sysdeps/generic/setenv.c
+++ b/sysdeps/generic/setenv.c
@@ -61,6 +61,8 @@ __libc_lock_define_initialized (static, envlock)
# define setenv __setenv
# define unsetenv __unsetenv
# define clearenv __clearenv
+# define tfind __tfind
+# define tsearch __tsearch
#endif
/* In the GNU C library implementation we try to be more clever and
@@ -75,8 +77,20 @@ __libc_lock_define_initialized (static, envlock)
values. */
static void *known_values;
-# define KNOWN_VALUE(Str) tfind (Str, &known_values, (__compar_fn_t) strcmp)
-# define STORE_VALUE(Str) tsearch (Str, &known_values, (__compar_fn_t) strcmp)
+# define KNOWN_VALUE(Str) \
+ ({ \
+ void **value = tfind (Str, &known_values, (__compar_fn_t) strcmp); \
+ if (value != NULL) \
+ value = *(const char **) value; \
+ value; \
+ })
+# define STORE_VALUE(Str) \
+ ({ \
+ void **value = tsearch (Str, &known_values, (__compar_fn_t) strcmp); \
+ if (value != NULL) \
+ value = *(const char **) value; \
+ value; \
+ })
#else
# undef USE_TSEARCH
@@ -240,7 +254,7 @@ unsetenv (name)
char **dp = ep;
/* Store the value so that we can reuse it later. */
- STORE_VALUE (ep);
+ STORE_VALUE (*ep);
do
dp[0] = dp[1];
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 9b07535816..5517ba8803 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -80,6 +80,7 @@ enum __socket_type
#define PF_ASH 18 /* Ash. */
#define PF_ECONET 19 /* Acorn Econet. */
#define PF_ATMSVC 20 /* ATM SVCs. */
+#define PF_SNA 22 /* Linux SNA Project */
#define PF_MAX 32 /* For now.. */
/* Address families. */
@@ -107,6 +108,7 @@ enum __socket_type
#define AF_ASH PF_ASH
#define AF_ECONET PF_ECONET
#define AF_ATMSVC PF_ATMSVC
+#define AF_SNA PF_SNA
#define AF_MAX PF_MAX
/* Socket level values. Others are defined in the appropriate headers.