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

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

View file

@ -17,7 +17,7 @@
#include "realm.h"
#include "user.h"
int chatty9p = 1;
int chatty9p = 0;
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.tree = alloctree(nil, nil, DMDIR | 0777, fs_destroy_file);
tree = fs.tree;