summaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-02-21 11:15:54 +0000
committerJakub Jelinek <jakub@redhat.com>2007-02-21 11:15:54 +0000
commitb428b742cf54d423e5a7a68fcbec9473303eeafa (patch)
treea7eb4bb9273b2c48c1d4deacb5458f5075d902ef /malloc
parent6c8cc2d3042d0585741452006c29cb21fbba39ea (diff)
Updated to fedora-glibc-20070221T1011cvs/fedora-glibc-2_5_90-18
Diffstat (limited to 'malloc')
-rwxr-xr-xmalloc/memusage.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/malloc/memusage.sh b/malloc/memusage.sh
index 67af4998ca..eace785cf4 100755
--- a/malloc/memusage.sh
+++ b/malloc/memusage.sh
@@ -77,6 +77,15 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
exit 0
}
+# These variables are local
+buffer=
+data=
+memusagestat_args=
+notimer=
+png=
+progname=
+tracemmap=
+
# Process arguments. But stop as soon as the program name is found.
while test $# -gt 0; do
case "$1" in
@@ -213,15 +222,8 @@ datafile=
if test -n "$data"; then
datafile="$data"
elif test -n "$png"; then
- datafile=$(mktemp ${TMPDIR:-/tmp}/memusage.XXXXXX 2> /dev/null)
- if test $? -ne 0; then
- # Lame, but if there is no `mktemp' program the user cannot expect more.
- if test "$RANDOM" != "$RANDOM"; then
- datafile=${TMPDIR:-/tmp}/memusage.$RANDOM
- else
- datafile=${TMPDIR:-/tmp}/memusage.$$
- fi
- fi
+ datafile=$(mktemp -t memusage.XXXXXX) || exit
+ trap 'rm -f "$datafile"; exit 1' HUP INT QUIT TERM PIPE
fi
if test -n "$datafile"; then
add_env="$add_env MEMUSAGE_OUTPUT=$datafile"