chiark / gitweb /
Does not work yet - must trap other calls too
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 1 Nov 2009 20:35:22 +0000 (20:35 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 1 Nov 2009 20:35:22 +0000 (20:35 +0000)
jpctb
jwrap-script-jpctb

diff --git a/jpctb b/jpctb
index b2aa7213f07798013d65fb673270e0bde32527db..c50b43baaed84e476373a57e34db8b99fd39cce4 100755 (executable)
--- a/jpctb
+++ b/jpctb
@@ -7,10 +7,10 @@ END
 jpctb_base="$0"
 jpctb_base="${jpctb_base%/*}"
 
-if [ $* -lt 2 ]; then usage >&2; exit 127; if
+if [ $# -lt 2 ]; then usage >&2; exit 127; fi
 
 export JWRAP_EXTDIR="$1"; shift
-export JWRAP_SCRIPT="$jpctb_base/jwrap-script-pctb"
+export JWRAP_SCRIPT="$jpctb_base/jwrap-script-jpctb"
 
 if [ x"$LD_PRELOAD" != x ]; then LD_PRELOAD="$LD_PRELOAD:"; fi
 export LD_PRELOAD="${LD_PRELOAD}$jpctb_base/libjwrap.so.1.0"
index f6fe699d3e207ea0ec529fd958cf5ab4671f323d..117e720c64c522f1f52d40de0ede7de1697aa237 100755 (executable)
@@ -1,6 +1,10 @@
 #!/bin/bash
 set -e$JWRAP_SCRIPT_X
 
+exec 4>&2
+exec 2>>/home/ian/u
+date >&2
+
 unwire () {
        ldp="$LD_PRELOAD:"
        ldp2=''
@@ -23,7 +27,7 @@ unwire () {
        unset JWRAP_SCRIPT
 }
 
-echo ":$*"
+true jwrap-script-pctb: "$@"
 
 path="$1"; shift
 arg0="$1"; shift
@@ -53,4 +57,4 @@ if [ x"$lastarg" = x"com.threerings.yohoho.client.YoApp" ]; then
        unwire
 fi
 
-exec -a "$arg0" /dev/jwrap/bypass "$path" "$@"
+exec -a "$arg0" /dev/jwrap/bypass "$path" "$@" 2>&4