add debug flag to command line and fix launcher script

This commit is contained in:
Iris Lightshard 2021-10-16 11:23:46 -06:00
parent 66241ad354
commit df0c7b0219
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
2 changed files with 18 additions and 5 deletions

View file

@ -6,14 +6,21 @@ if [ -z "${DISPLAY}"]; then
export DISPLAY=:0 export DISPLAY=:0
fi fi
seat=$(echo ${DISPLAY} | awk -F. '{print $1}')
debug=""
case $1 in case $1 in
start) start)
./xrxs -s xrxs & sleep 1 if [ "$2" = "-d" ]; then
9pserve -c unix!/tmp/ns.$(whoami).${DISPLAY}/xrxs tcp!0.0.0.0!${PORT} & debug="-d"
fi
./xrxs -s xrxs ${debug} & sleep 1
9pserve -c unix!/tmp/ns.$(whoami).${seat}/xrxs tcp!0.0.0.0!${PORT} &
;; ;;
stop) stop)
killall xrxs killall xrxs
rm /tmp/ns.$(whoami).${DISPLAY}/xrxs rm /tmp/ns.$(whoami).${seat}/xrxs
;; ;;
*) *)
echo "$0 start|stop" echo "$0 start|stop"

View file

@ -17,7 +17,7 @@
#include "realm.h" #include "realm.h"
#include "user.h" #include "user.h"
int chatty9p = 1; int chatty9p = 0;
static Tree* tree; static Tree* tree;
@ -606,6 +606,12 @@ void threadmain(int argc, char* argv[]) {
} }
} }
for (i = 0; i < argc; i++) {
if (scmp(argv[i], "-d")) {
chatty9p = 1;
}
}
fs.foreground = 1; fs.foreground = 1;
fs.tree = alloctree(nil, nil, DMDIR | 0777, fs_destroy_file); fs.tree = alloctree(nil, nil, DMDIR | 0777, fs_destroy_file);
tree = fs.tree; tree = fs.tree;