This commit is contained in:
Russ Cox 2005-11-04 17:06:57 +00:00
parent 3f22e19560
commit 9f66cd80b3
3 changed files with 39 additions and 25 deletions

View File

@ -1,7 +1,7 @@
# Unix # Unix
AR=ar AR=ar
AS=as AS=as
CC=gcc CC=gcc -Wall
RANLIB=ranlib RANLIB=ranlib
CFLAGS=-I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -ggdb -D_THREAD_SAFE -pthread # not ready for this yet: -Wall CFLAGS=-I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -ggdb -D_THREAD_SAFE -pthread # not ready for this yet: -Wall
O=o O=o

10
README
View File

@ -23,9 +23,13 @@ See http://swtch.com/drawterm/
TO DO: TO DO:
------ ------
- Drawterm seems to have ssl synchronization problems.
Specifically, fcp bigfile /mnt/term/tmp reliably wedges it.
- Should clean up the code so that gcc -Wall doesn't print - Should clean up the code so that gcc -Wall doesn't print
any warnings. any warnings.
- Should import latest /dev/draw to allow resize of window
- Should copy 9term code and make console window a real
9term window instead.
- Should implement /dev/label.

52
cpu.c
View File

@ -82,6 +82,25 @@ usage(void)
} }
int fdd; int fdd;
int
mountfactotum(void)
{
int fd;
if((fd = dialfactotum()) < 0)
return;
if(sysmount(fd, -1, "/mnt/factotum", MREPL, "") < 0){
fprint(2, "mount factotum: %r\n");
return;
}
if((fd = open("/mnt/factotum/ctl", OREAD)) < 0){
fprint(2, "open /mnt/factotum/ctl: %r\n");
return;
}
close(fd);
return 0;
}
void void
cpumain(int argc, char **argv) cpumain(int argc, char **argv)
{ {
@ -140,27 +159,18 @@ cpumain(int argc, char **argv)
usage(); usage();
}ARGEND; }ARGEND;
if((fd = dialfactotum()) < 0) if(mountfactotum() < 0){
fprint(2, "dial factotum: %r\n"); if(secstoreserver == nil)
else if(sysmount(fd, -1, "/mnt/factotum", MREPL, "") < 0) secstoreserver = authserver;
fprint(2, "mount factotum: %r\n"); if(havesecstore(secstoreserver, user)){
else if((fd = open("/mnt/factotum/ctl", OREAD)) < 0) s = secstorefetch(secstoreserver, user, nil);
fprint(2, "open /mnt/factotum/ctl: %r\n"); if(s){
else if(strlen(s) >= sizeof secstorebuf)
close(fd); panic("secstore data too big");
strcpy(secstorebuf, s);
if(secstoreserver == nil) }
secstoreserver = authserver; }
}
if(secstoreserver && havesecstore(secstoreserver, user)){
s = secstorefetch(secstoreserver, user, nil);
if(s){
if(strlen(s) >= sizeof secstorebuf)
panic("secstore data too big");
strcpy(secstorebuf, s);
}
}
if(argc != 0) if(argc != 0)
usage(); usage();