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 b2aa721..c50b43b 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 f6fe699..117e720 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