Skip to contentSkip to conversation

ldt.h: Fix typo in modify_ldt()

PATCH In review Ricardo B. Marlière via ltp 2 participants 4 messages May 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ldt.h: Fix typo in modify_ldt()

From: Ricardo B. Marlière <[email protected]>

Fixes 5d8cb5a3ef37 ("ldt.h: Add workaround for x86_64")
---
 include/lapi/ldt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/lapi/ldt.h +1 -1
index 173321dd9ac34ba87eff0eee960635f30d878991..331f25b444a48c4c7f1833c376fb69404029846c 100644
@@ -46,7 +46,7 @@ static inline int modify_ldt(int func, const struct user_desc *ptr,
 	if (rval > 0 && (int)rval < 0) {
 		tst_res(TINFO,
 			"WARNING: Libc mishandled modify_ldt() return value");
-		errno = -(int)errno;
+		errno = -(int)rval;
 		rval = -1;
 	}
 #endif /* __x86_64__ */

---
base-commit: 5d8cb5a3ef3749eb26ee22d96c9654bfde43030f
change-id: 20250521-fixes-modify_ldt-9eb99ab171ed

Best regards,

Signature · 5 lines
Ricardo B. Marlière <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author Acked-by Andrea Cervesato on v1 1/1
#1 lore raw

Hi,

thanks for fixing it. @Martin feel free to merge if you think it's fine.

Quoted 27 lines · Ricardo B. Marlière via ltp

From: Ricardo B. Marlière <[email protected]>

Fixes 5d8cb5a3ef37 ("ldt.h: Add workaround for x86_64")
---
  include/lapi/ldt.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/lapi/ldt.h +1 -2
index 173321dd9ac34ba87eff0eee960635f30d878991..331f25b444a48c4c7f1833c376fb69404029846c 100644
@@ -46,7 +46,7 @@ static inline int modify_ldt(int func, const struct user_desc *ptr,
  	if (rval > 0 && (int)rval < 0) {
  		tst_res(TINFO,
  			"WARNING: Libc mishandled modify_ldt() return value");
-		errno = -(int)errno;
+		errno = -(int)rval;
  		rval = -1;
  	}
  #endif /* __x86_64__ */
 
---

base-commit: 5d8cb5a3ef3749eb26ee22d96c9654bfde43030f
change-id: 20250521-fixes-modify_ldt-9eb99ab171ed

Best regards,

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by
#2 lore raw
Quoted 3 lines · Andrea Cervesato

Hi,

thanks for fixing it. @Martin feel free to merge if you think it's fine.

Sorry, I don't have push access to the main LTP repo. Also:

Quoted 31 lines
Quoted 28 lines · Ricardo B. Marlière via ltp

From: Ricardo B. Marlière <[email protected]>

Fixes 5d8cb5a3ef37 ("ldt.h: Add workaround for x86_64")

---
  include/lapi/ldt.h | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
include/lapi/ldt.h +1 -1
index 173321dd9ac34ba87eff0eee960635f30d878991..331f25b444a48c4c7f1833c376fb69404029846c 100644
@@ -46,7 +46,7 @@ static inline int modify_ldt(int func, const struct 
 user_desc *ptr,
       if (rval > 0 && (int)rval < 0) {
           tst_res(TINFO,
               "WARNING: Libc mishandled modify_ldt() return value");
-        errno = -(int)errno;
+        errno = -(int)rval;
           rval = -1;
       }

  #endif /* __x86_64__ */

---
base-commit: 5d8cb5a3ef3749eb26ee22d96c9654bfde43030f
change-id: 20250521-fixes-modify_ldt-9eb99ab171ed

Best regards,

Signature · 10 lines
Martin Doucha   [email protected]
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Merged, thanks!

Quoted 43 lines · Martin Doucha
Quoted 3 lines · Andrea Cervesato

Hi,

thanks for fixing it. @Martin feel free to merge if you think it's fine.

Sorry, I don't have push access to the main LTP repo. Also:

Quoted 31 lines
Quoted 28 lines · Ricardo B. Marlière via ltp

From: Ricardo B. Marlière <[email protected]>

Fixes 5d8cb5a3ef37 ("ldt.h: Add workaround for x86_64")

---
  include/lapi/ldt.h | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
include/lapi/ldt.h +1 -1
index 173321dd9ac34ba87eff0eee960635f30d878991..331f25b444a48c4c7f1833c376fb69404029846c 100644
@@ -46,7 +46,7 @@ static inline int modify_ldt(int func, const 
 struct user_desc *ptr,
       if (rval > 0 && (int)rval < 0) {
           tst_res(TINFO,
               "WARNING: Libc mishandled modify_ldt() return value");
-        errno = -(int)errno;
+        errno = -(int)rval;
           rval = -1;
       }

  #endif /* __x86_64__ */

---
base-commit: 5d8cb5a3ef3749eb26ee22d96c9654bfde43030f
change-id: 20250521-fixes-modify_ldt-9eb99ab171ed

Best regards,

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp