changeset 35947:f156407eef7b

configure: Delete temporary files when a configure run is interrupted.
author diego
date Fri, 22 Mar 2013 16:36:10 +0000
parents ebc74746041d
children ab41adf81569
files configure
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Fri Mar 22 15:37:40 2013 +0000
+++ b/configure	Fri Mar 22 16:36:10 2013 +0000
@@ -1471,6 +1471,12 @@
 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
 
+cleanup() {
+  rm -rf "$mplayer_tmpdir"
+}
+
+trap cleanup EXIT
+
 TMPLOG="config.log"
 TMPC="$mplayer_tmpdir/tmp.c"
 TMPCPP="$mplayer_tmpdir/tmp.cpp"
@@ -9320,4 +9326,4 @@
 fi
 
 # Last move:
-rm -rf "$mplayer_tmpdir"
+cleanup