From 98525461c875ab0808b7bfa4787d13ee2d413c40 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 11 Feb 2011 18:00:55 +0000 Subject: [PATCH] * mkstatic: Make sure that we are not cd'ed to temporary directory on exit to avoid bogus warnings on directory cleanup. * speclib: Ditto. * mkimport: Ditto. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/mkimport | 5 ++++- winsup/cygwin/mkstatic | 6 +++++- winsup/cygwin/speclib | 4 ++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a255a9ba1..ba0f2227e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2011-02-11 Christopher Faylor + + * mkstatic: Make sure that we are not cd'ed to temporary directory on + exit to avoid bogus warnings on directory cleanup. + * speclib: Ditto. + * mkimport: Ditto. + 2011-02-11 Christopher Faylor * cygwin.sc: Eliminate __cygheap_mid. diff --git a/winsup/cygwin/mkimport b/winsup/cygwin/mkimport index 70c81048f..1dfcab3f4 100755 --- a/winsup/cygwin/mkimport +++ b/winsup/cygwin/mkimport @@ -80,5 +80,8 @@ for my $f (keys %text) { unlink $libdll; system $ar, 'crus', $libdll, glob('*.o'), @ARGV; unlink glob('*.o'); -chdir '/tmp'; # Allow $dir directory removal on Windows exit 1 if $?; + +END { + chdir '/tmp'; # Allow $dir directory removal on Windows +} diff --git a/winsup/cygwin/mkstatic b/winsup/cygwin/mkstatic index b7a81b0ad..1a488f80c 100755 --- a/winsup/cygwin/mkstatic +++ b/winsup/cygwin/mkstatic @@ -55,5 +55,9 @@ exit 0; sub xsystem(@) { print join(' ', 'x', @_), "\n" if $x; - system(@_) == 0 or die "$0: @_[0] $_[1] $_[2]... exited with non-zero status\n"; + system(@_) == 0 or die "$0: $_[0] $_[1] $_[2]... exited with non-zero status\n"; +} + +END { + chdir '/tmp'; # Allow $dir directory removal on Windows } diff --git a/winsup/cygwin/speclib b/winsup/cygwin/speclib index 7ac4d1cff..7bac7eac4 100755 --- a/winsup/cygwin/speclib +++ b/winsup/cygwin/speclib @@ -76,3 +76,7 @@ $res = system $ar, 'crus', $lib, sort keys %extract; unlink keys %extract; die "$0: ar creation of $lib exited with non-zero status\n" if $res; exit 0; + +END { + chdir '/tmp'; # Allow $dir directory removal on Windows +}