cpu: fix p9any v.2 negotiation

This commit is contained in:
Erik Quanstrom 2010-12-28 20:58:28 -05:00
parent a568eea78d
commit 7211f00b30
1 changed files with 12 additions and 11 deletions

5
cpu.c
View File

@ -560,6 +560,7 @@ p9any(int fd)
if((afd = open("/mnt/factotum/ctl", ORDWR)) >= 0)
return p9anyfactotum(fd, afd);
werrstr("");
if(readstr(fd, buf, sizeof buf) < 0)
fatal(1, "cannot read p9any negotiation");
@ -582,8 +583,8 @@ p9any(int fd)
if(write(fd, buf2, strlen(buf2)+1) != strlen(buf2)+1)
fatal(1, "cannot write user/domain choice in p9any");
if(v2){
if(readstr(fd, buf, sizeof buf) != 3)
fatal(1, "cannot read OK in p9any");
if(readstr(fd, buf, sizeof buf) < 0)
fatal(1, "cannot read OK in p9any: got %d %s", n, buf);
if(memcmp(buf, "OK\0", 3) != 0)
fatal(1, "did not get OK in p9any");
}