[PATCH] consistently use MAX_ERRNO in __syscall_return
[linux-2.6-microblaze.git] / include / asm-frv / unistd.h
index b80dbd8..d104d1b 100644 (file)
 #ifdef __KERNEL__
 
 #define NR_syscalls 310
+#include <linux/err.h>
 
 /*
  * process the return value of a syscall, consigning it to one of two possible fates
 #define __syscall_return(type, res)                                    \
 do {                                                                   \
         unsigned long __sr2 = (res);                                   \
-       if (__builtin_expect(__sr2 >= (unsigned long)(-4095), 0)) {     \
+       if (__builtin_expect(__sr2 >= (unsigned long)(-MAX_ERRNO), 0)) { \
                errno = (-__sr2);                                       \
                __sr2 = ~0UL;                                           \
        }                                                               \