debugging for sam, and an old fix forgotten

This commit is contained in:
rsc 2005-01-07 18:03:36 +00:00
parent b80755cf2d
commit a19ff5b204
11 changed files with 28 additions and 7 deletions

2
bin/g
View file

@ -1,4 +1,4 @@
#!/usr/local/plan9/bin/rc #!/mit/rsc/plan9/bin/rc
flags=() flags=()
while(! ~ $#* 1 && ~ $1 -*){ while(! ~ $#* 1 && ~ $1 -*){

View file

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
exec /usr/local/plan9/bin/kill -9 "$@" exec $PLAN9/bin/kill -9 "$@"

View file

@ -590,6 +590,7 @@ extern void freenetconninfo(NetConnInfo*);
#define OCEXEC 32 /* or'ed in, close on exec */ #define OCEXEC 32 /* or'ed in, close on exec */
#define ORCLOSE 64 /* or'ed in, remove on close */ #define ORCLOSE 64 /* or'ed in, remove on close */
#define ODIRECT 128 /* or'ed in, direct access */ #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 OEXCL 0x1000 /* or'ed in, exclusive use (create only) */
#define OLOCK 0x2000 /* or'ed in, lock after opening */ #define OLOCK 0x2000 /* or'ed in, lock after opening */

View file

@ -24,6 +24,7 @@ sys(char *buf, int devnull)
_exit(2); _exit(2);
default: default:
waitpid(); waitpid();
fprint(2, "done waiting\n");
} }
} }

View file

@ -4,7 +4,7 @@ TARG=`ls *.[cy] | grep -v "\.tab\.c$" | sed 's/\.[cy]//'`
<$PLAN9/src/mkmany <$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$'` DIRS=lex `ls -l |sed -n 's/^d.* //p' |egrep -v "^($BUGGERED)$"|egrep -v '^lex$'`
<$PLAN9/src/mkdirs <$PLAN9/src/mkdirs

View file

@ -33,20 +33,27 @@ void
initio(void) initio(void)
{ {
threadsetname("main"); threadsetname("main");
if(protodebug) print("mouse\n");
mousectl = initmouse(nil, display->image); mousectl = initmouse(nil, display->image);
if(mousectl == nil){ if(mousectl == nil){
fprint(2, "samterm: mouse init failed: %r\n"); fprint(2, "samterm: mouse init failed: %r\n");
threadexitsall("mouse"); threadexitsall("mouse");
} }
mousep = &mousectl->m; mousep = &mousectl->m;
if(protodebug) print("kbd\n");
keyboardctl = initkeyboard(nil); keyboardctl = initkeyboard(nil);
if(keyboardctl == nil){ if(keyboardctl == nil){
fprint(2, "samterm: keyboard init failed: %r\n"); fprint(2, "samterm: keyboard init failed: %r\n");
threadexitsall("kbd"); threadexitsall("kbd");
} }
if(protodebug) print("hoststart\n");
hoststart(); hoststart();
if(plumbstart() < 0) if(protodebug) print("plumbstart\n");
if(plumbstart() < 0){
if(protodebug) print("extstart\n");
extstart(); extstart();
}
if(protodebug) print("initio done\n");
} }
void void

View file

@ -44,15 +44,22 @@ threadmain(int argc, char *argv[])
close(0); close(0);
close(1); close(1);
open("/dev/null", OREAD); 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); getscreen(argc, argv);
if(protodebug) print("iconinit\n");
iconinit(); iconinit();
if(protodebug) print("initio\n");
initio(); initio();
if(protodebug) print("scratch\n");
scratch = alloc(100*RUNESIZE); scratch = alloc(100*RUNESIZE);
nscralloc = 100; nscralloc = 100;
r = screen->r; r = screen->r;
r.max.y = r.min.y+Dy(r)/5; r.max.y = r.min.y+Dy(r)/5;
if(protodebug) print("flstart\n");
flstart(screen->clipr); flstart(screen->clipr);
rinit(&cmd.rasp); rinit(&cmd.rasp);
flnew(&cmd.l[0], gettext, 1, &cmd); flnew(&cmd.l[0], gettext, 1, &cmd);
@ -64,6 +71,7 @@ threadmain(int argc, char *argv[])
startnewfile(Tstartcmdfile, &cmd); startnewfile(Tstartcmdfile, &cmd);
got = 0; got = 0;
if(protodebug) print("loop\n");
for(;;got = waitforio()){ for(;;got = waitforio()){
if(hasunlocked && RESIZED()) if(hasunlocked && RESIZED())
resize(); resize();

View file

@ -158,7 +158,7 @@ extstart(void)
} }
} }
fd = open(exname, OREAD|O_NONBLOCK); fd = open(exname, OREAD|ONONBLOCK);
if(fd == -1){ if(fd == -1){
removeextern(); removeextern();
return; return;

View file

@ -28,6 +28,10 @@ p9open(char *name, int mode)
umode |= O_DIRECT; umode |= O_DIRECT;
mode ^= ODIRECT; mode ^= ODIRECT;
} }
if(mode&ONONBLOCK){
umode |= O_NONBLOCK;
mode ^= ONONBLOCK;
}
if(mode){ if(mode){
werrstr("mode 0x%x not supported", mode); werrstr("mode 0x%x not supported", mode);
return -1; return -1;

0
src/libmach/SunOS.c Normal file
View file

View file

@ -67,7 +67,7 @@ elfnm: elfnm.o $LIBDIR/$LIB
$LD -o $target $prereq -l9 $LD -o $target $prereq -l9
SunOS.$O: nosys.c #SunOS.$O: nosys.c
Darwin.$O: nosys.c Darwin.$O: nosys.c
OpenBSD.$O: nosys.c OpenBSD.$O: nosys.c
NetBSD.$O: nosys.c NetBSD.$O: nosys.c