Fix mips/mipsel syscall wrappers to return correct error values.
authorJurica Stanojkovic <Jurica.Stanojkovic@rt-rk.com>
Tue, 31 May 2016 18:38:08 +0000 (19:38 +0100)
committerGuillem Jover <guillem@debian.org>
Tue, 31 May 2016 18:38:08 +0000 (19:38 +0100)
Forwarded: no
Last-Update: 2012-09-24

Gbp-Pq: Name 00_arches_mips.patch

src/syscall-mips.h

index 41424992e2005919b7c2d38489af9cb8c3a99257..31de13a4c0406fdca73538724a21bed809131ba2 100644 (file)
@@ -76,7 +76,7 @@ type fname(atype a) \
        \
        if (__a3 == 0) \
                return (type) __v0; \
-       return (type) -1; \
+       return (type) 0 - __v0; \
 }
 
 #define io_syscall2(type,fname,sname,atype,a,btype,b) \
@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
        \
        if (__a3 == 0) \
                return (type) __v0; \
-       return (type) -1; \
+       return (type) 0 - __v0; \
 }
 
 #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
        \
        if (__a3 == 0) \
                return (type) __v0; \
-       return (type) -1; \
+       return (type) 0 - __v0; \
 }
 
 #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dtype d) \
        \
        if (__a3 == 0) \
                return (type) __v0; \
-       return (type) -1; \
+       return (type) 0 - __v0; \
 }
 
 #if (_MIPS_SIM == _MIPS_SIM_ABI32)
@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dtype d, etype e) \
        \
        if (__a3 == 0) \
                return (type) __v0; \
-       return (type) -1; \
+       return (type) 0 - __v0; \
 }
 
 #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtype d,etype e) \
        \
        if (__a3 == 0) \
                return (type) __v0; \
-       return (type) -1; \
+       return (type) 0 - __v0; \
 }
 
 #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */