aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-07 18:02:39 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-07 18:02:39 +0000
commit2556bfe6fdb5ccb4864e0249d5fdd475e4100c71 (patch)
treeceb6911987c23a31476484b3c390ce85057c597c
parent9ae6fc542a6267377078f1c64f45bc9bd2a96da5 (diff)
downloadglibc-2556bfe6fdb5ccb4864e0249d5fdd475e4100c71.zip
glibc-2556bfe6fdb5ccb4864e0249d5fdd475e4100c71.tar.gz
glibc-2556bfe6fdb5ccb4864e0249d5fdd475e4100c71.tar.bz2
Update.
* sysdeps/generic/setenv.c: Describe problem. * malloc/malloc.c (request2size): Also set errno if failing.
-rw-r--r--ChangeLog4
-rw-r--r--malloc/malloc.c1
-rw-r--r--sysdeps/generic/setenv.c19
3 files changed, 22 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8cf3f3d..558a16d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1999-07-07 Ulrich Drepper <drepper@cygnus.com>
- * malloc/malloc.c (request2size): Also set errno of failing.
+ * sysdeps/generic/setenv.c: Describe problem.
+
+ * malloc/malloc.c (request2size): Also set errno if failing.
* malloc/malloc.c (request2size): Take care of overflow in
addition.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 86f25d5..31ab045 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -314,6 +314,7 @@
extern "C" {
#endif
+#include <errno.h>
#include <stdio.h> /* needed for malloc_stats */
diff --git a/sysdeps/generic/setenv.c b/sysdeps/generic/setenv.c
index 21d9b67..a5818d0 100644
--- a/sysdeps/generic/setenv.c
+++ b/sysdeps/generic/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,6 +16,23 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* Issues:
+
+ 1. putenv must not use setenv since the string provided by the user
+ must be used, not a copy
+
+ 2. a common function should determine the place where to insert the
+ new entry and if necessary take care of extending the array
+
+ 3. It must be kept track of whether an entry was inserted via putenv
+ or setenv. In the former case the entry must not be put into
+ the search tree since removing it could mean it will not be
+ available anymore (e.g., when allocated on the stack)
+
+ To handle this an array parallel to the __environ array must specify
+ whether the entry was added via putenv or not
+*/
+
#if HAVE_CONFIG_H
# include <config.h>
#endif