From 73bd57524a80a46826a5a71e1b34305df7471e09 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 12 Apr 2009 05:11:08 +0000 Subject: [PATCH] * speclib: Initial stab at cleaning up temp files. More work needed. * mkimport: Ditto. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/mkimport | 4 +++- winsup/cygwin/speclib | 9 ++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index db1e19ee3..8069d646e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-04-12 Christopher Faylor + + * speclib: Initial stab at cleaning up temp files. More work needed. + * mkimport: Ditto. + 2009-04-12 Christopher Faylor * Makefile.in (clean): Clean globals.h. diff --git a/winsup/cygwin/mkimport b/winsup/cygwin/mkimport index 58c604180..99d8ef049 100755 --- a/winsup/cygwin/mkimport +++ b/winsup/cygwin/mkimport @@ -77,4 +77,6 @@ for my $f (keys %text) { } unlink $libdll; -exec $ar, 'crus', $libdll, glob('*.o'), @ARGV; +system $ar, 'crus', $libdll, glob('*.o'), @ARGV; +unlink glob('*.o'); +exit 1 if $?; diff --git a/winsup/cygwin/speclib b/winsup/cygwin/speclib index 80ef23301..80744083a 100755 --- a/winsup/cygwin/speclib +++ b/winsup/cygwin/speclib @@ -1,6 +1,6 @@ #!/usr/bin/perl use Getopt::Long; -use File::Temp qw'tempdir'; +use File::Temp; use File::Basename; use File::Spec; use strict; @@ -43,11 +43,14 @@ close $nm_fd; %extract or die "$0: couldn't find symbols for $lib\n"; -my $dir = tempdir(CLEANUP => 1); +my $dir = File::Temp->newdir(); chdir $dir; # print join(' ', '+', $ar, 'x', sort keys %extract), "\n"; my $res = system $ar, 'x', $libdll, sort keys %extract; die "$0: $ar extraction exited with non-zero status\n" if $res; unlink $lib; -exec $ar, 'crus', $lib, sort keys %extract; +$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;