diff options
author | rsc <devnull@localhost> | 2005-01-07 18:03:36 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-07 18:03:36 +0000 |
commit | a19ff5b204a5e36ae522feb4acc0f31542b95f38 (patch) | |
tree | 9f03f972fe7615d0c763fb680a0a837e4f625729 /src/cmd/samterm | |
parent | b80755cf2d7bfaed4c8120cbd9b874f799e65644 (diff) | |
download | plan9port-a19ff5b204a5e36ae522feb4acc0f31542b95f38.tar.gz plan9port-a19ff5b204a5e36ae522feb4acc0f31542b95f38.tar.bz2 plan9port-a19ff5b204a5e36ae522feb4acc0f31542b95f38.zip |
debugging for sam, and an old fix forgotten
Diffstat (limited to 'src/cmd/samterm')
-rw-r--r-- | src/cmd/samterm/io.c | 9 | ||||
-rw-r--r-- | src/cmd/samterm/main.c | 10 | ||||
-rw-r--r-- | src/cmd/samterm/plan9.c | 2 |
3 files changed, 18 insertions, 3 deletions
diff --git a/src/cmd/samterm/io.c b/src/cmd/samterm/io.c index 30a707a0..d9cf2e83 100644 --- a/src/cmd/samterm/io.c +++ b/src/cmd/samterm/io.c @@ -33,20 +33,27 @@ void initio(void) { threadsetname("main"); + if(protodebug) print("mouse\n"); mousectl = initmouse(nil, display->image); if(mousectl == nil){ fprint(2, "samterm: mouse init failed: %r\n"); threadexitsall("mouse"); } mousep = &mousectl->m; + if(protodebug) print("kbd\n"); keyboardctl = initkeyboard(nil); if(keyboardctl == nil){ fprint(2, "samterm: keyboard init failed: %r\n"); threadexitsall("kbd"); } + if(protodebug) print("hoststart\n"); hoststart(); - if(plumbstart() < 0) + if(protodebug) print("plumbstart\n"); + if(plumbstart() < 0){ + if(protodebug) print("extstart\n"); extstart(); + } + if(protodebug) print("initio done\n"); } void diff --git a/src/cmd/samterm/main.c b/src/cmd/samterm/main.c index 9a485b51..c56ea5f8 100644 --- a/src/cmd/samterm/main.c +++ b/src/cmd/samterm/main.c @@ -44,15 +44,22 @@ threadmain(int argc, char *argv[]) close(0); close(1); open("/dev/null", OREAD); - dup(2, 1); + if(open("/dev/tty", OWRITE) < 0) + open("/dev/null", OWRITE); +dup(2, 1); + if(protodebug) print("getscreen\n"); getscreen(argc, argv); + if(protodebug) print("iconinit\n"); iconinit(); + if(protodebug) print("initio\n"); initio(); + if(protodebug) print("scratch\n"); scratch = alloc(100*RUNESIZE); nscralloc = 100; r = screen->r; r.max.y = r.min.y+Dy(r)/5; + if(protodebug) print("flstart\n"); flstart(screen->clipr); rinit(&cmd.rasp); flnew(&cmd.l[0], gettext, 1, &cmd); @@ -64,6 +71,7 @@ threadmain(int argc, char *argv[]) startnewfile(Tstartcmdfile, &cmd); got = 0; + if(protodebug) print("loop\n"); for(;;got = waitforio()){ if(hasunlocked && RESIZED()) resize(); diff --git a/src/cmd/samterm/plan9.c b/src/cmd/samterm/plan9.c index e860ea58..5f5c33d0 100644 --- a/src/cmd/samterm/plan9.c +++ b/src/cmd/samterm/plan9.c @@ -158,7 +158,7 @@ extstart(void) } } - fd = open(exname, OREAD|O_NONBLOCK); + fd = open(exname, OREAD|ONONBLOCK); if(fd == -1){ removeextern(); return; |