summaryrefslogtreecommitdiff
path: root/nfs/nfs.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-08-12 18:31:04 +0000
committerThomas Bushnell <thomas@gnu.org>1996-08-12 18:31:04 +0000
commit9474c6318ad2effa3e80246d1012cb111e726bf0 (patch)
treeb1f5dbfbd38913dcc4ebf721f81443472937dec0 /nfs/nfs.c
parent4b4fc640461f0f6e152204deda38a4e9272fe9e1 (diff)
*** empty log message ***
Diffstat (limited to 'nfs/nfs.c')
-rw-r--r--nfs/nfs.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/nfs/nfs.c b/nfs/nfs.c
index 617ca334..ae7e677f 100644
--- a/nfs/nfs.c
+++ b/nfs/nfs.c
@@ -401,8 +401,39 @@ nfs_error_trans (int error)
return ESTALE;
case NFSERR_WFLUSH:
- default:
+ /* Not known in v3, but we just give EINVAL for unknown errors
+ so it's the same. */
return EINVAL;
+
+ default:
+ if (protocol_version == 2)
+ return EINVAL;
+ else
+ switch (error)
+ {
+ case NFSERR_XDEV:
+ return EXDEV;
+
+ case NFSERR_INVAL:
+ case NFSERR_REMOTE: /* not sure about this one */
+ default:
+ return EINVAL;
+
+ case NFSERR_MLINK:
+ return EMLINK;
+
+ case NFSERR_NOTSUPP:
+ return EOPNOTSUPP;
+
+ case NFSERR_BADHANDLE:
+ case NFSERR_NOT_SYNC:
+ case NFSERR_BAD_COOKIE:
+ case NFSERR_TOOSMALL:
+ case NFSERR_SERVERFAULT: /* perhaps EIO instead?? */
+ case NFSERR_BADTYPE:
+ case NFSERR_JUKEBOX: /* ??? */
+ /* These indicate bugs in the client, so EGRATUITOUS is right. */
+ return EGRATUITOUS;
+ }
}
}
-