code: drawterm

Download patch

ref: e4f9a4578a50e9b6694514e7c94004f4b82f6eab
parent: 5d6ebf7a53a2992d56e7403afd5cfce59b15e879
author: Russ Cox <rsc@swtch.com>
date: Wed Nov 2 10:20:27 EST 2005

windows

--- a/Make.unix
+++ b/Make.unix
@@ -10,3 +10,7 @@
 LDFLAGS=-pthread
 TARG=drawterm
 
+# for root
+libmachdep.a:
+	arch=`uname -m|sed 's/i.86/386/;s/Power Macintosh/power/'`; \
+	(cd posix-$$arch &&  make)
--- a/Make.win32
+++ b/Make.win32
@@ -14,7 +14,7 @@
 IP=win32
 OS=win32
 GUI=win32
-LDFLAGS=
+LDFLAGS=-mwindows
 LDADD=-lkernel32 -ladvapi32 -lgdi32 -lmpr -lwsock32
 TARG=drawterm.exe
 
@@ -27,4 +27,8 @@
 #IP=win32
 #OS=win32
 #GUI=win32
+
+# for root
+libmachdep.a:
+	(cd win32-386; make)
 
--- a/Makefile
+++ b/Makefile
@@ -69,10 +69,3 @@
 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)
-
--- a/include/lib.h
+++ b/include/lib.h
@@ -244,3 +244,9 @@
 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*);
+
--- a/kern/devcons.c
+++ b/kern/devcons.c
@@ -456,7 +456,7 @@
 	kc[nk++] = c;
 	c = latin1(kc, nk);
 	if(c < -1)  /* need more keystrokes */
-		return;
+		return 0;
 	if(c != -1) /* valid sequence */
 		_kbdputc(c);
 	else
--- a/kern/procinit.c
+++ b/kern/procinit.c
@@ -59,7 +59,7 @@
 	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;
--- a/secstore.c
+++ b/secstore.c
@@ -195,7 +195,7 @@
 	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;
 	}