Commit Diff


commit - 39dbe6e72b5e0ffc7989da7f1e59f41498d2b492
commit + 724b43e60e9cda4648934865aecaadfa455a3e76
blob - 1c5f1cdf38b8ed7a0b5d915acdd9b4f910af85ab
blob + 5af9a7284c1a08cb68595b4df57356bd7d088f70
--- bin/9l
+++ 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