diff options
Diffstat (limited to 'src/wrapped32')
| -rwxr-xr-x | src/wrapped32/wrappedlibc.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c index 418430d9..5a829510 100755 --- a/src/wrapped32/wrappedlibc.c +++ b/src/wrapped32/wrappedlibc.c @@ -2120,12 +2120,20 @@ EXPORT int32_t my32_fcntl64(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, ui d1 = of_convert32(d1); if(b==F_GETLK64 || b==F_SETLK64 || b==F_SETLKW64) { - my_flock64_t fl; + my_flock64_t fl = {0}; AlignFlock64_32(&fl, from_ptrv(d1)); int ret = fcntl(a, b, &fl); UnalignFlock64_32(from_ptrv(d1), &fl); return ret; } + if(b==F_GETLK || b==F_SETLK || b==F_SETLKW) + { + struct flock fl = {0}; + AlignFlock_32(&fl, from_ptrv(d1)); + int ret = fcntl(a, b, &fl); + UnalignFlock_32(from_ptrv(d1), &fl); + return ret; + } //TODO: check if better to use the syscall or regular fcntl? //return syscall(__NR_fcntl64, a, b, d1); // should be enough int ret = fcntl(a, b, d1); @@ -2151,12 +2159,20 @@ EXPORT int32_t my32_fcntl(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint d1 = of_convert32(d1); if(b==F_GETLK64 || b==F_SETLK64 || b==F_SETLKW64) { - my_flock64_t fl; + my_flock64_t fl = {0}; AlignFlock64_32(&fl, from_ptrv(d1)); int ret = fcntl(a, b, &fl); UnalignFlock64_32(from_ptrv(d1), &fl); return ret; } + if(b==F_GETLK || b==F_SETLK || b==F_SETLKW) + { + struct flock fl = {0}; + AlignFlock_32(&fl, from_ptrv(d1)); + int ret = fcntl(a, b, &fl); + UnalignFlock_32(from_ptrv(d1), &fl); + return ret; + } int ret = fcntl(a, b, d1); if(b==F_GETFL && ret!=-1) ret = of_unconvert32(ret); |