From 9f66cd80b33731d08e59233dabfd4771507dd149 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 4 Nov 2005 17:06:57 +0000 Subject: [PATCH] updates --- Make.unix | 2 +- README | 10 +++++++--- cpu.c | 52 +++++++++++++++++++++++++++++++--------------------- 3 files changed, 39 insertions(+), 25 deletions(-) diff --git a/Make.unix b/Make.unix index aaf792f..eff26c1 100644 --- a/Make.unix +++ b/Make.unix @@ -1,7 +1,7 @@ # Unix AR=ar AS=as -CC=gcc +CC=gcc -Wall RANLIB=ranlib CFLAGS=-I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -ggdb -D_THREAD_SAFE -pthread # not ready for this yet: -Wall O=o diff --git a/README b/README index d286915..2c7d32f 100644 --- a/README +++ b/README @@ -23,9 +23,13 @@ See http://swtch.com/drawterm/ 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 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. + diff --git a/cpu.c b/cpu.c index 213a96f..06948cc 100644 --- a/cpu.c +++ b/cpu.c @@ -82,6 +82,25 @@ usage(void) } 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 cpumain(int argc, char **argv) { @@ -140,27 +159,18 @@ cpumain(int argc, char **argv) usage(); }ARGEND; - if((fd = dialfactotum()) < 0) - fprint(2, "dial factotum: %r\n"); - else if(sysmount(fd, -1, "/mnt/factotum", MREPL, "") < 0) - fprint(2, "mount factotum: %r\n"); - else if((fd = open("/mnt/factotum/ctl", OREAD)) < 0) - fprint(2, "open /mnt/factotum/ctl: %r\n"); - else - close(fd); - - 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(mountfactotum() < 0){ + if(secstoreserver == nil) + secstoreserver = authserver; + if(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) usage();