commit a19ff5b204a5e36ae522feb4acc0f31542b95f38 from: rsc date: Fri Jan 07 18:03:36 2005 UTC debugging for sam, and an old fix forgotten commit - b80755cf2d7bfaed4c8120cbd9b874f799e65644 commit + a19ff5b204a5e36ae522feb4acc0f31542b95f38 blob - c9e8b92976d5c82247fa4c0918cda240a2262595 blob + 26d065e1e6573c95539190060a6e32664ffc4c5b --- bin/g +++ bin/g @@ -1,4 +1,4 @@ -#!/usr/local/plan9/bin/rc +#!/mit/rsc/plan9/bin/rc flags=() while(! ~ $#* 1 && ~ $1 -*){ blob - c3a99332c7709240339dcc99390bfec93adecfb9 blob + e1aaf71430396f18aa67ed30bb76e792f7c296d4 --- bin/slay +++ bin/slay @@ -1,3 +1,3 @@ #!/bin/sh -exec /usr/local/plan9/bin/kill -9 "$@" +exec $PLAN9/bin/kill -9 "$@" blob - d907468160a12b2e91c2582ce0cf8a11ed2b7d9d blob + b84e34b159644812b3af8c36f355a3442ebbab64 --- include/libc.h +++ include/libc.h @@ -590,6 +590,7 @@ extern void freenetconninfo(NetConnInfo*); #define OCEXEC 32 /* or'ed in, close on exec */ #define ORCLOSE 64 /* or'ed in, remove on close */ #define ODIRECT 128 /* or'ed in, direct access */ +#define ONONBLOCK 256 /* or'ed in, non-blocking call */ #define OEXCL 0x1000 /* or'ed in, exclusive use (create only) */ #define OLOCK 0x2000 /* or'ed in, lock after opening */ blob - 1aa46dce549c0ca409d04c617e82ce6f045d9a54 blob + edf161c291992925d729fa940cb09a24753b0398 --- src/cmd/9term/rcstart.c +++ src/cmd/9term/rcstart.c @@ -24,6 +24,7 @@ sys(char *buf, int devnull) _exit(2); default: waitpid(); +fprint(2, "done waiting\n"); } } blob - 51e6ed6f832cfbdac63a2f4769294dae23ac2013 blob + ea036ac9e09f6c8af6d0dc4faeee9935d44207ee --- src/cmd/mkfile +++ src/cmd/mkfile @@ -4,7 +4,7 @@ TARG=`ls *.[cy] | grep -v "\.tab\.c$" | sed 's/\.[cy]/ <$PLAN9/src/mkmany -BUGGERED='CVS|faces|factotum|mailfs|page|scat|upas|venti|vncv|postscript|mnihongo|mpm|index' +BUGGERED='CVS|acid|db|faces|factotum|mailfs|page|scat|upas|venti|vncv|postscript|mnihongo|mpm|index' DIRS=lex `ls -l |sed -n 's/^d.* //p' |egrep -v "^($BUGGERED)$"|egrep -v '^lex$'` <$PLAN9/src/mkdirs blob - 30a707a05a1c32a610a71527dbab0397b605fe4c blob + d9cf2e83348b7576b9348b951ff54ca0ad2492fe --- src/cmd/samterm/io.c +++ 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 blob - 9a485b519b7436572be263b3327d2fc1be187398 blob + c56ea5f84c5fe09a78d13e30420433240ed54462 --- src/cmd/samterm/main.c +++ 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(); blob - e860ea5833eb2f07051896d213b1c81217238637 blob + 5f5c33d07068f036e6824465635725bcac5be212 --- src/cmd/samterm/plan9.c +++ 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; blob - 896ca52854c12b313907c949124949f81dbbe7da blob + e76aabe3181ca3dd4bf776e24cd7fbb5e6738e9a --- src/lib9/open.c +++ src/lib9/open.c @@ -28,6 +28,10 @@ p9open(char *name, int mode) umode |= O_DIRECT; mode ^= ODIRECT; } + if(mode&ONONBLOCK){ + umode |= O_NONBLOCK; + mode ^= ONONBLOCK; + } if(mode){ werrstr("mode 0x%x not supported", mode); return -1; blob - /dev/null blob + e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (mode 644) blob - 53d1af99e49643bc1192684b64acedd445efdbbf blob + 25a3a877d443e150f376dd4f3e160b8de60a1265 --- src/libmach/mkfile +++ src/libmach/mkfile @@ -67,7 +67,7 @@ elfnm: elfnm.o $LIBDIR/$LIB $LD -o $target $prereq -l9 -SunOS.$O: nosys.c +#SunOS.$O: nosys.c Darwin.$O: nosys.c OpenBSD.$O: nosys.c NetBSD.$O: nosys.c