From 3becac2ca38bb01d31564a9bd854d5a4b41e456b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 2 Oct 2012 09:37:39 +0200 Subject: [PATCH] nfsclient: Fix for short enums The XDR library has a problem on architectures with short enums like the default ARM EABI. Short enums means that the size of the enum type is variable and the smallest integer type to hold all enum values will be selected. For many enums this is char. The XDR library uses int32_t for enum_t. There are several evil casts from an enum type to enum_t which leads to invalid memory accesses on short enum architectures. A workaround is to add appropriate dummy enum values. --- cpukit/libfs/src/nfsclient/proto/nfs_prot.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpukit/libfs/src/nfsclient/proto/nfs_prot.h b/cpukit/libfs/src/nfsclient/proto/nfs_prot.h index de812dbfcf..054a77efea 100644 --- a/cpukit/libfs/src/nfsclient/proto/nfs_prot.h +++ b/cpukit/libfs/src/nfsclient/proto/nfs_prot.h @@ -48,6 +48,7 @@ enum nfsstat { NFSERR_DQUOT = 69, NFSERR_STALE = 70, NFSERR_WFLUSH = 99, + _NFSSTAT = 0xffffffff }; typedef enum nfsstat nfsstat; @@ -61,6 +62,7 @@ enum ftype { NFSOCK = 6, NFBAD = 7, NFFIFO = 8, + _FTYPE = 0xffffffff }; typedef enum ftype ftype;