about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-05-14 14:39:34 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-05-14 14:39:34 +0200
commitb818a29499b91faa2a222606802526073969e3c2 (patch)
tree62b315ab2e5fd626851cdfe7407f13d09deb91f6 /src
parent69c88442b4db4a66eb1c50639ac826f6e9c5c945 (diff)
downloadbox64-b818a29499b91faa2a222606802526073969e3c2.tar.gz
box64-b818a29499b91faa2a222606802526073969e3c2.zip
[WRAPPER] Reduce the warning on of_unconvert helper function
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/wrappedlibc.c7
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 631b270c..0ee05f00 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -582,7 +582,7 @@ int EXPORT my_uname(struct utsname *buf)
 #define X86_O_NONBLOCK     0x800    // octal    04000
 #define X86_O_SYNC         0x101000 // octal 04010000
 #define X86_O_DSYNC        0x1000   // octal   010000
-#define X86_O_RSYNC        O_SYNC
+#define X86_O_RSYNC        X86_O_SYNC
 #define X86_FASYNC         020000
 #define X86_O_DIRECT       040000
 #define X86_O_LARGEFILE    0100000
@@ -651,8 +651,11 @@ int of_unconvert(int a)
     #define GO(A) if((a&(A))==(A)) {a&=~(A); b|=(X86_##A);}
     SUPER();
     #undef GO
+    int missing = 0;
+    if(!O_NOFOLLOW) missing |= X86_O_NOFOLLOW;
+    if(!O_LARGEFILE) missing |= X86_O_LARGEFILE;
     // flags 0x20000 unknown?!
-    if(a && (a&~0x20000)) {
+    if(a && (a&~missing)) {
         printf_log(LOG_NONE, "Warning, of_unconvert(...) left over 0x%x, converted 0x%x\n", a, b);
     }
     return a|b;
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index 6d9f473f..fb67dcda 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -633,7 +633,7 @@ int EXPORT my32_uname(struct utsname *buf)
 #define X86_O_NONBLOCK     0x800    // octal    04000
 #define X86_O_SYNC         0x101000 // octal 04010000
 #define X86_O_DSYNC        0x1000   // octal   010000
-#define X86_O_RSYNC        O_SYNC
+#define X86_O_RSYNC        X86_O_SYNC
 #define X86_FASYNC         020000
 #define X86_O_DIRECT       040000
 #define X86_O_LARGEFILE    0100000
@@ -695,7 +695,10 @@ int of_unconvert32(int a)
     #define GO(A) if((a&A)==A) {a&=~A; b|=X86_##A;}
     SUPER();
     #undef GO
-    if(a) {
+    int missing = 0;
+    if(!O_NOFOLLOW) missing |= X86_O_NOFOLLOW;
+    if(!O_LARGEFILE) missing |= X86_O_LARGEFILE;
+    if(a && (a&~missing)) {
         printf_log(LOG_NONE, "Warning, of_unconvert32(...) left over 0x%x, converted 0x%x\n", a, b);
     }
     return a|b;