diff options
Diffstat (limited to 'netfs/daemonMisc.cpp')
-rw-r--r-- | netfs/daemonMisc.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/netfs/daemonMisc.cpp b/netfs/daemonMisc.cpp index e3cebc3..2341b21 100644 --- a/netfs/daemonMisc.cpp +++ b/netfs/daemonMisc.cpp @@ -7,6 +7,8 @@ #include "daemon.h" #include "misc.h" +extern std::map<int, int> files; + handler(AccessRequest) { TypedPayload<AccessRequest::Reply> * r = new TypedPayload<AccessRequest::Reply>(); @@ -25,8 +27,13 @@ handler(FgetAttrRequest) { TypedPayload<FgetAttrRequest::Reply> * r = new TypedPayload<FgetAttrRequest::Reply>(); errno = 0; - r->data.res = fstat(req->data.handle, &r->data.val); - r->data.res = errno; + if (files.find(req->data.handle) != files.end()) { + fstat(files[req->data.handle], &r->data.val); + r->data.res = errno; + } + else { + r->data.res = EBADF; + } s.Send(r); } handler(SymlinkRequest) @@ -38,6 +45,7 @@ handler(SymlinkRequest) } else { r->data.value = 0; + s.replicatedRequest = true; } s.Send(r); } @@ -50,6 +58,7 @@ handler(LinkRequest) } else { r->data.value = 0; + s.replicatedRequest = true; } s.Send(r); } @@ -62,6 +71,7 @@ handler(RenameRequest) } else { r->data.value = 0; + s.replicatedRequest = true; } s.Send(r); } @@ -90,6 +100,7 @@ handler(ChmodRequest) } else { r->data.value = 0; + s.replicatedRequest = true; } s.Send(r); } @@ -102,6 +113,7 @@ handler(ChownRequest) } else { r->data.value = 0; + s.replicatedRequest = true; } s.Send(r); } |