win32 build; add -r option

This commit is contained in:
Russ Cox 2009-08-25 22:46:22 -07:00
parent 5df8776caf
commit 3bab3a220a
4 changed files with 15 additions and 6 deletions

8
cpu.c
View File

@ -29,6 +29,7 @@ static AuthInfo *p9any(int);
static char *system; static char *system;
static int cflag; static int cflag;
extern int dbg; extern int dbg;
extern char* base; // fs base for devroot
static char *srvname = "ncpu"; static char *srvname = "ncpu";
static char *ealgs = "rc4_256 sha1"; static char *ealgs = "rc4_256 sha1";
@ -146,12 +147,15 @@ cpumain(int argc, char **argv)
case 'k': case 'k':
keyspec = EARGF(usage()); keyspec = EARGF(usage());
break; break;
case 'u': case 'r':
user = EARGF(usage()); base = EARGF(usage());
break; break;
case 's': case 's':
secstoreserver = EARGF(usage()); secstoreserver = EARGF(usage());
break; break;
case 'u':
user = EARGF(usage());
break;
default: default:
usage(); usage();
}ARGEND; }ARGEND;

View File

@ -1312,7 +1312,7 @@ printmesg(char *fmt, uchar *a, int plsprnt)
SET(p); SET(p);
USED(fmt); USED(fmt);
USED(a); USED(a);
USED(buf); p = buf;
USED(p); USED(p);
USED(q); USED(q);
USED(s); USED(s);

View File

@ -1,3 +1,8 @@
/*
* Disable Unicode until the calls to FindFirstFile etc
* are changed to use wide character strings.
*/
#undef UNICODE
#include <windows.h> #include <windows.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -593,7 +598,7 @@ fsdirread(Chan *c, uchar *va, int count, ulong offset)
d.length = stbuf.st_size; d.length = stbuf.st_size;
d.type = 'U'; d.type = 'U';
d.dev = c->dev; d.dev = c->dev;
n = convD2M(&d, (char*)va+i, count-i); n = convD2M(&d, (uchar*)va+i, count-i);
if(n == BIT16SZ){ if(n == BIT16SZ){
strcpy(uif->nextname, de); strcpy(uif->nextname, de);
break; break;
@ -634,7 +639,7 @@ readdir(char *name, DIR *d)
if(FindNextFile(d->handle, &d->wfd) == FALSE) if(FindNextFile(d->handle, &d->wfd) == FALSE)
return 0; return 0;
} }
strcpy(name, d->wfd.cFileName); strcpy(name, (char*)d->wfd.cFileName);
d->index++; d->index++;
return 1; return 1;

View File

@ -178,7 +178,7 @@ hostlookup(char *host)
he = gethostbyname(host); he = gethostbyname(host);
if(he != 0 && he->h_addr_list[0]) { if(he != 0 && he->h_addr_list[0]) {
p = he->h_addr_list[0]; p = (uchar*)he->h_addr_list[0];
sprint(buf, "%ud.%ud.%ud.%ud", p[0], p[1], p[2], p[3]); sprint(buf, "%ud.%ud.%ud.%ud", p[0], p[1], p[2], p[3]);
} else } else
strcpy(buf, host); strcpy(buf, host);