From 9474c6318ad2effa3e80246d1012cb111e726bf0 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Mon, 12 Aug 1996 18:31:04 +0000 Subject: *** empty log message *** --- nfsd/ChangeLog | 19 +++++++++++++++++++ nfsd/Makefile | 2 +- nfsd/loop.c | 2 +- nfsd/main.c | 7 +++---- nfsd/nfsd.h | 2 +- nfsd/xdr.c | 21 +++++++++++++++++++-- 6 files changed, 44 insertions(+), 9 deletions(-) (limited to 'nfsd') diff --git a/nfsd/ChangeLog b/nfsd/ChangeLog index 08f6dbb5..6edf4199 100644 --- a/nfsd/ChangeLog +++ b/nfsd/ChangeLog @@ -1,3 +1,22 @@ +Mon Aug 12 11:15:15 1996 Thomas Bushnell, n/BSG + + * Makefile (installationdir): Include quotes in variable expansion + here. + * main.c: Build index_file better. + + * xdr.c (nfs_error_trans): New errors for IO and XDEV don't have + prefixed E. + + * main.c (main): Cast second cthread_fork args. + + * nfsd.h (nfs_error_trans): Add new arg to prototype. + +Thu Aug 8 19:20:31 1996 Thomas Bushnell, n/BSG + + * xdr.c (nfs_error_trans): New parm `version'. All callers + changed. If we are version 3, then return one of the new v3 error + codes if appropriate. + Wed Aug 7 11:39:31 1996 Thomas Bushnell, n/BSG * main.c (index_file): New var. diff --git a/nfsd/Makefile b/nfsd/Makefile index 4460b4ba..265301f3 100644 --- a/nfsd/Makefile +++ b/nfsd/Makefile @@ -29,6 +29,6 @@ installationdir = $(sbindir) include ../Makeconf -CPPFLAGS += -DLOCALSTATEDIR=$(localstatedir) +CPPFLAGS += -DLOCALSTATEDIR=\"$(localstatedir)\" nfsd: ../libthreads/libthreads.a ../libshouldbeinlibc/libshouldbeinlibc.a \ No newline at end of file diff --git a/nfsd/loop.c b/nfsd/loop.c index c7053234..38edae62 100644 --- a/nfsd/loop.c +++ b/nfsd/loop.c @@ -195,7 +195,7 @@ server_loop (int fd) if (proc->process_error && err) { r = errloc; - *r++ = htonl (nfs_error_trans (err)); + *r++ = htonl (nfs_error_trans (err, version)); } cred_rele (cred); diff --git a/nfsd/main.c b/nfsd/main.c index b4b8464a..d4d040c6 100644 --- a/nfsd/main.c +++ b/nfsd/main.c @@ -27,8 +27,7 @@ int main_udp_socket, pmap_udp_socket; struct sockaddr_in main_address, pmap_address; -#define INDEX_FILE_NAME(dir) # dir "/state/misc/nfsd.index" -static char index_file[] = INDEX_FILE_NAME (LOCALSTATEDIR); +static char index_file[] = LOCALSTATEDIR "/state/misc/nfsd.index"; char *index_file_name = index_file; int @@ -79,11 +78,11 @@ main (int argc, char **argv) init_filesystems (); cthread_detach (cthread_fork ((cthread_fn_t) server_loop, - pmap_udp_socket)); + (any_t) pmap_udp_socket)); while (nthreads--) cthread_detach (cthread_fork ((cthread_fn_t) server_loop, - main_udp_socket)); + (any_t) main_udp_socket)); for (;;) { diff --git a/nfsd/nfsd.h b/nfsd/nfsd.h index 0ea93703..c8ec86e2 100644 --- a/nfsd/nfsd.h +++ b/nfsd/nfsd.h @@ -116,7 +116,7 @@ void server_loop (int); extern struct proctable nfstable, mounttable, pmaptable; /* xdr.c */ -int nfs_error_trans (error_t); +int nfs_error_trans (error_t, int); int *encode_fattr (int *, struct stat *); int *decode_name (int *, char **); int *encode_fhandle (int *, char *); diff --git a/nfsd/xdr.c b/nfsd/xdr.c index 5b13b2a5..57ee1fdf 100644 --- a/nfsd/xdr.c +++ b/nfsd/xdr.c @@ -139,7 +139,7 @@ encode_statfs (int *p, struct statfs *st) /* Return an NFS error corresponding to Hurd error ERR. */ int -nfs_error_trans (error_t err) +nfs_error_trans (error_t err, int version) { switch (err) { @@ -153,7 +153,6 @@ nfs_error_trans (error_t err) return NFSERR_NOENT; case EIO: - default: return NFSERR_IO; case ENXIO: @@ -194,6 +193,24 @@ nfs_error_trans (error_t err) case ESTALE: return NFSERR_STALE; + + default: + if (version == 2) + return NFSERR_IO; + else switch (err) + { + case EXDEV: + return NFSERR_XDEV; + + case EINVAL: + return NFSERR_INVAL; + + case EOPNOTSUPP: + return NFSERR_NOTSUPP; /* are we sure here? */ + + default: + return NFSERR_IO; + } } } -- cgit v1.2.3