[RALink Driver/Linux] Driver/UTIL/include/os/rt_linux.h:278: error: expected specifier-qualifier-list before ‘kuid_t’

This error comes up on some linux machines (most notably updated CentOS/RHEL 6) when trying to compile the driver for RALink devices:

Driver/UTIL/include/os/rt_linux.h:278: error: expected specifier-qualifier-list before ‘kuid_t’

 

This is due to this particular section of code in that file:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)

kuid_t                          fsuid;

kgid_t                          fsgid;

#else

int                             fsuid;

int                             fsgid;

#endif

This part of that header file is changing the data type for fsuid and fsguid for kernel versions > 2.6.29.  My suspicions are that RedHat has patched their versions of those kernels for backwards compatibility and that this probably is no issue on other distros.  To fix this just change to the following:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)

int                          fsuid;

int                          fsgid;

#else

int                             fsuid;

int                             fsgid;

#endif

This allows it to compile without a problem.  This identical header file exists in two different subdirectories so don’t be discouraged when the error appears to still be there.  Just go ahead and change it in the other identically named file and run “make” again.