From e4f9a4578a50e9b6694514e7c94004f4b82f6eab Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 2 Nov 2005 15:20:27 +0000 Subject: [PATCH] windows --- Make.unix | 4 ++++ Make.win32 | 6 +++++- Makefile | 7 ------- include/lib.h | 6 ++++++ kern/devcons.c | 2 +- kern/procinit.c | 2 +- secstore.c | 2 +- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Make.unix b/Make.unix index b300b0f..ddaf7b0 100644 --- a/Make.unix +++ b/Make.unix @@ -10,3 +10,7 @@ LDADD=-L/usr/X11R6/lib -lX11 -ggdb LDFLAGS=-pthread TARG=drawterm +# for root +libmachdep.a: + arch=`uname -m|sed 's/i.86/386/;s/Power Macintosh/power/'`; \ + (cd posix-$$arch && make) diff --git a/Make.win32 b/Make.win32 index 2e9e41e..42b2928 100644 --- a/Make.win32 +++ b/Make.win32 @@ -14,7 +14,7 @@ FS=fs-win32 IP=win32 OS=win32 GUI=win32 -LDFLAGS= +LDFLAGS=-mwindows LDADD=-lkernel32 -ladvapi32 -lgdi32 -lmpr -lwsock32 TARG=drawterm.exe @@ -28,3 +28,7 @@ TARG=drawterm.exe #OS=win32 #GUI=win32 +# for root +libmachdep.a: + (cd win32-386; make) + diff --git a/Makefile b/Makefile index 2c1bb77..4d164ac 100644 --- a/Makefile +++ b/Makefile @@ -69,10 +69,3 @@ libc/libc.a: gui-$(GUI)/libgui.a: (cd gui-$(GUI); make) -#libmachdep.a: -# arch=`uname -m|sed 's/i.86/386/;s/Power Macintosh/power/'`; \ -# (cd gcc$$arch && make) - -libmachdep.a: - (cd posix-386; make) - diff --git a/include/lib.h b/include/lib.h index 88de366..a2175e8 100644 --- a/include/lib.h +++ b/include/lib.h @@ -244,3 +244,9 @@ extern int nrand(int); extern long lrand(void); extern long lnrand(long); extern double frand(void); + +extern ulong getcallerpc(void*); +extern char* cleanname(char*); +extern void sysfatal(char*, ...); +extern char* strecpy(char*, char*, char*); + diff --git a/kern/devcons.c b/kern/devcons.c index 8f64ef8..ce9fb5a 100644 --- a/kern/devcons.c +++ b/kern/devcons.c @@ -456,7 +456,7 @@ kbdputc(Queue *q, int c) kc[nk++] = c; c = latin1(kc, nk); if(c < -1) /* need more keystrokes */ - return; + return 0; if(c != -1) /* valid sequence */ _kbdputc(c); else diff --git a/kern/procinit.c b/kern/procinit.c index a3eadbe..b2299d9 100644 --- a/kern/procinit.c +++ b/kern/procinit.c @@ -59,7 +59,7 @@ kproc(char *name, void (*fn)(void*), void *arg) p->fgrp = up->fgrp; if(p->fgrp) incref(&p->fgrp->ref); - strecpy(p->text, sizeof p->text, name); + strecpy(p->text, p->text+sizeof p->text, name); osproc(p); return p->pid; diff --git a/secstore.c b/secstore.c index 368172a..bf72cc9 100644 --- a/secstore.c +++ b/secstore.c @@ -195,7 +195,7 @@ SC_read(SConn *conn, uchar *buf, int n) uchar count[2], digest[SHA1dlen]; int len, nr; - if(read(ss->fd, count, 2) != 2 || count[0]&0x80 == 0){ + if(read(ss->fd, count, 2) != 2 || (count[0]&0x80) == 0){ werrstr("!SC_read invalid count"); return -1; }