]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/sshfs.c
sshfs: usage
[plan9front.git] / sys / src / cmd / sshfs.c
index e42b7807a2f99950d669eb1ff186676edda5a45a..c25b4eba867b752cfb7902d25aa984949b9ad207 100644 (file)
@@ -934,7 +934,7 @@ recvproc(void *)
        SFid *sf;
        int t, id;
        u32int code;
-       char *msg, *lang, *hand;
+       char *msg, *lang, *hand, *s;
        int msgn, langn, handn;
        int okresp;
        char *e;
@@ -1011,6 +1011,14 @@ recvproc(void *)
                        sf->handn = handn;
                        sf->hand = emalloc9p(sf->handn);
                        memcpy(sf->hand, hand, sf->handn);
+                       if(r->req->ifcall.type == Tcreate){
+                               s = sf->fn;
+                               sf->fn = pathcat(s, r->req->ifcall.name);
+                               free(s);
+                               sf->qid = (Qid){qidcalc(sf->fn), 0, (r->req->ifcall.perm & DMDIR) != 0 ? QTDIR : 0};
+                               r->req->ofcall.qid = sf->qid;
+                               r->req->fid->qid = sf->qid;
+                       }
                        wunlock(sf);
                        if(r->req->ifcall.type == Tread){
                                r->req->aux = nil;
@@ -1312,7 +1320,7 @@ void
 usage(void)
 {
        static char *common = "[-abdRUG] [-s service] [-m mtpt] [-u uidfile] [-g gidfile]";
-       fprint(2, "usage: %s %s [-- ssh-options] host\n", argv0, common);
+       fprint(2, "usage: %s %s [-- ssh-options] [user@]host\n", argv0, common);
        fprint(2, "       %s %s -c cmdline\n", argv0, common);
        fprint(2, "       %s %s -p\n", argv0, common);
        exits("usage");