x11, used, etc.

This commit is contained in:
rsc 2005-11-12 16:36:48 +00:00
parent 21d0dda69c
commit 16c1defa3d
4 changed files with 31 additions and 18 deletions

View file

@ -71,7 +71,7 @@ after this auto-detection and can be used to override the choices.
If If
.B LOCAL.config .B LOCAL.config
contains a line contains a line
.B WSYS=nowsys .B WSYSTYPE=nowsys
then the system is built without using X11. then the system is built without using X11.
.SH FILES .SH FILES
.TP .TP

View file

@ -123,7 +123,7 @@ int ignorepipe(void*, char*);
int timefmt(Fmt*); int timefmt(Fmt*);
void dorootstat(void); void dorootstat(void);
int stripudirread(Msg*); int stripudirread(Msg*);
int stripustat(Fcall*, uchar**, int); int cvtustat(Fcall*, uchar**, int);
void void
usage(void) usage(void)
@ -464,7 +464,7 @@ connthread(void *arg)
} }
m->fid->ref++; m->fid->ref++;
if(m->tx.type==Twstat && dotu && !c->dotu){ if(m->tx.type==Twstat && dotu && !c->dotu){
if(stripustat(&m->tx, &m->tpkt, 1) < 0){ if(cvtustat(&m->tx, &m->tpkt, 1) < 0){
err(m, "cannot convert stat buffer"); err(m, "cannot convert stat buffer");
continue; continue;
} }
@ -790,7 +790,7 @@ connoutthread(void *arg)
break; break;
case Tstat: case Tstat:
if(!err && dotu && !m->c->dotu) if(!err && dotu && !m->c->dotu)
stripustat(&m->rx, &m->rpkt, 0); cvtustat(&m->rx, &m->rpkt, 0);
break; break;
case Topen: case Topen:
case Tcreate: case Tcreate:
@ -802,6 +802,7 @@ connoutthread(void *arg)
m->rx.ename = ename; m->rx.ename = ename;
repack(&m->rx, &m->rpkt, c->dotu); repack(&m->rx, &m->rpkt, c->dotu);
free(ename); free(ename);
m->rx.ename = "XXX";
} }
if(delhash(m->c->tag, m->ctag, m) == 0) if(delhash(m->c->tag, m->ctag, m) == 0)
msgput(m); msgput(m);
@ -973,6 +974,7 @@ fidput(Fid *f)
Msg **msgtab; Msg **msgtab;
int nmsgtab; int nmsgtab;
int nmsg;
Msg *freemsg; Msg *freemsg;
void void
@ -999,6 +1001,7 @@ msgnew(int x)
m->ref = 1; m->ref = 1;
if(verbose > 1) fprint(2, "%T msgnew @0x%lux %p tag %d ref %d\n", if(verbose > 1) fprint(2, "%T msgnew @0x%lux %p tag %d ref %d\n",
getcallerpc(&x), m, m->tag, m->ref); getcallerpc(&x), m, m->tag, m->ref);
nmsg++;
return m; return m;
} }
@ -1050,6 +1053,7 @@ msgput(Msg *m)
assert(m->ref > 0); assert(m->ref > 0);
if(--m->ref > 0) if(--m->ref > 0)
return; return;
nmsg--;
msgclear(m); msgclear(m);
if(m->tpkt){ if(m->tpkt){
free(m->tpkt); free(m->tpkt);
@ -1141,6 +1145,7 @@ sendq(Queue *q, void *p)
e = emalloc(sizeof(Qel)); e = emalloc(sizeof(Qel));
qlock(&q->lk); qlock(&q->lk);
if(q->hungup){ if(q->hungup){
free(e);
werrstr("hungup queue"); werrstr("hungup queue");
qunlock(&q->lk); qunlock(&q->lk);
return -1; return -1;
@ -1376,7 +1381,7 @@ timefmt(Fmt *fmt)
} }
int int
stripustat(Fcall *f, uchar **fpkt, int s2u) cvtustat(Fcall *f, uchar **fpkt, int tounix)
{ {
int n; int n;
uchar *buf; uchar *buf;
@ -1384,20 +1389,21 @@ stripustat(Fcall *f, uchar **fpkt, int s2u)
Dir dir; Dir dir;
str = emalloc(f->nstat); str = emalloc(f->nstat);
n = convM2Du(f->stat, f->nstat, &dir, str, s2u); n = convM2Du(f->stat, f->nstat, &dir, str, !tounix);
if(n <= BIT16SZ) if(n <= BIT16SZ){
free(str);
return -1; return -1;
n = sizeD2Mu(&dir, !s2u); }
buf = emalloc(n);
n = convD2Mu(&dir, buf, n, !s2u); n = sizeD2Mu(&dir, tounix);
if(n <= BIT16SZ) buf = emalloc(n);
return -1; convD2Mu(&dir, f->stat, n, tounix);
f->nstat = n; f->nstat = n;
f->stat = buf; f->stat = buf;
repack(f, fpkt, dotu); repack(f, fpkt, dotu);
free(buf); free(buf);
f->stat = nil; /* is this okay ??? */
free(str); free(str);
return 0; return 0;
@ -1454,6 +1460,7 @@ stripudirread(Msg* msg)
repack(&msg->rx, &msg->rpkt, 0); repack(&msg->rx, &msg->rpkt, 0);
free(str); free(str);
free(buf); free(buf);
rx->data = nil; /* is this okay ??? */
return 0; return 0;
} }

View file

@ -17,19 +17,27 @@ if [ "x$X11" = "x" ]; then
fi fi
if [ "x$WSYSTYPE" = "x" ]; then if [ "x$WSYSTYPE" = "x" ]; then
if [ -d "$X11/include" ]; then if [ -d "$X11" ]; then
WSYSTYPE=x11 WSYSTYPE=x11
else else
WSYSTYPE=nowsys WSYSTYPE=nowsys
fi fi
fi fi
if [ "x$WSYSTYPE" = "xX11" -a "x$X11H" = "x" ]; then
if [ -d "$X11/include" ]; then
X11H="-I$X11/include"
else
X11H=""
fi
fi
echo 'WSYSTYPE='$WSYSTYPE echo 'WSYSTYPE='$WSYSTYPE
echo 'X11='$X11 echo 'X11='$X11
if [ $WSYSTYPE = x11 ]; then if [ $WSYSTYPE = x11 ]; then
echo 'CFLAGS=$CFLAGS -I$X11/include' echo 'CFLAGS=$CFLAGS $X11H'
echo 'HFILES=$HFILES $XHFILES' echo 'HFILES=$HFILES $XHFILES'
fi fi

View file

@ -17,8 +17,6 @@ drawtopwindow(void)
void void
drawresizewindow(Rectangle r) drawresizewindow(Rectangle r)
{ {
USED(r);
bad(); bad();
} }