summaryrefslogtreecommitdiff
path: root/tools/libstyx/styxserver.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libstyx/styxserver.c')
-rw-r--r--tools/libstyx/styxserver.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/libstyx/styxserver.c b/tools/libstyx/styxserver.c
index d0bf1c2c..34257349 100644
--- a/tools/libstyx/styxserver.c
+++ b/tools/libstyx/styxserver.c
@@ -114,7 +114,7 @@ newclient(Styxserver *server, int fd)
c->state = 0;
c->fids = nil;
c->uname = strdup(eve);
- c->aname = strdup(eve);
+ c->aname = strdup("");
c->next = server->clients;
server->clients = c;
if(server->ops->newclient)
@@ -167,7 +167,7 @@ rd(Client *c, Fcall *r)
{
if(c->nc > 0){ /* last convM2S consumed nc bytes */
c->nread -= c->nc;
- if(c->nread < 0){
+ if((int)c->nread < 0){
r->ename = "negative size in rd";
return -1;
}
@@ -903,7 +903,7 @@ run(Client *c)
break;
case Tattach:
if(Debug)
- fprint(2, "Tattach %d %s\n", f.fid, f.uname[0] ? f.uname : c->uname);
+ fprint(2, "Tattach %d %s %s\n", f.fid, f.uname[0] ? f.uname : c->uname, f.aname[0]? f.aname: c->aname);
if(fp){
f.type = Rerror;
f.ename = "fid in use";
@@ -1065,3 +1065,9 @@ styxqid(int path, int isdir)
q.type = 0;
return q;
}
+
+void
+styxsetowner(char *name)
+{
+ eve = name;
+}