about summary refs log tree commit diff stats
path: root/src/wrapped32/wrappedlibc.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-12-04 16:58:05 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-12-04 16:58:05 +0100
commit9165ec875a36b2d146b7749f8da9bc14f3bb635b (patch)
treeca4ba6d04d55456e432e92b1b8cd7f9ac2897bd9 /src/wrapped32/wrappedlibc.c
parent6a7997b41eccd62c9743b52e80033a586aebd006 (diff)
downloadbox64-9165ec875a36b2d146b7749f8da9bc14f3bb635b.tar.gz
box64-9165ec875a36b2d146b7749f8da9bc14f3bb635b.zip
[BOX32] Some fixes to a few file related 32bits wrapped function (now windows gog installer can be used with box32 and wine)
Diffstat (limited to 'src/wrapped32/wrappedlibc.c')
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index 5e9ccfe9..e5fa0d71 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -457,7 +457,7 @@ EXPORT int my32_statvfs64(x64emu_t* emu, void* f, void* r)
 {
     struct statvfs s = {0};
     int ret = statvfs(f, &s);
-    if(r)
+    if(r>=0)
         UnalignStatVFS64_32(&s, r);
     return ret;
 }
@@ -466,7 +466,25 @@ EXPORT int my32_statvfs(x64emu_t* emu, void* f, void* r)
 {
     struct statvfs s = {0};
     int ret = statvfs(f, &s);
-    if(r)
+    if(r>=0)
+        UnalignStatVFS_32(&s, r);
+    return ret;
+}
+
+EXPORT int my32_fstatvfs64(x64emu_t* emu, int fd, void* r)
+{
+    struct statvfs s = {0};
+    int ret = fstatvfs(fd, &s);
+    if(r>=0)
+        UnalignStatVFS64_32(&s, r);
+    return ret;
+}
+
+EXPORT int my32_fstatvfs(x64emu_t* emu, int fd, void* r)
+{
+    struct statvfs s = {0};
+    int ret = fstatvfs(fd, &s);
+    if(r>=0)
         UnalignStatVFS_32(&s, r);
     return ret;
 }