aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-07 18:51:26 +0000
committerrsc <devnull@localhost>2005-01-07 18:51:26 +0000
commit724b43e60e9cda4648934865aecaadfa455a3e76 (patch)
tree8e58b297f386a3324ccaf98c907b64808a6199af /bin
parent39dbe6e72b5e0ffc7989da7f1e59f41498d2b492 (diff)
downloadplan9port-724b43e60e9cda4648934865aecaadfa455a3e76.tar.gz
plan9port-724b43e60e9cda4648934865aecaadfa455a3e76.tar.bz2
plan9port-724b43e60e9cda4648934865aecaadfa455a3e76.zip
remove target on failure (sun)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/9l13
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/9l b/bin/9l
index 1c5f1cdf..5af9a728 100755
--- a/bin/9l
+++ b/bin/9l
@@ -15,6 +15,12 @@ then
verbose=true
fi
+target=a.out
+if [ "x$1" = "x-o" ]
+then
+ target=$2
+fi
+
if $doautolib
then
ofiles=""
@@ -188,4 +194,9 @@ if $verbose
then
echo $ld -L$PLAN9/lib "$@" $libsl $extralibs
fi
-exec $ld -L$PLAN9/lib "$@" $libsl $extralibs
+if ! $ld -L$PLAN9/lib "$@" $libsl $extralibs
+do
+ rm -f $target
+ exit 1
+done
+exit 0