Skip to contentSkip to conversation

fix bug in host_to_target_bitmask

PATCH New Harald Welte 1 participant 1 message Nov 9, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix bug in host_to_target_bitmask

Hi!

While running software in i386 user mode emulation on my PPC box, I discovered that fcntl(F_GETFL) always returned (O_RDWR|O_WRONLY) instead of just O_RDWR. Some debugging code inside syscall.c confirmed that 0x02 was erroneously converted to 0x03.

After some reading through the code, I found that host_to_target_bitmask() erroneously uses x86_mask instead of x86_bits.

Please apply the following fix:

thunk.c +1 -1
diff -u -r1.4 thunk.c
@@ -236,7 +236,7 @@
 
     for(btp = trans_tbl; btp->x86_mask && btp->alpha_mask; btp++) {
 	if((alpha_mask & btp->alpha_mask) == btp->alpha_bits) {
-	    x86_mask |= btp->x86_mask;
+	    x86_mask |= btp->x86_bits;
 	}
     }
     return(x86_mask);
Signature · 3 lines
- Harald Welte <[email protected]>               http://www.gnumonks.org/
============================================================================
Programming is like sex: One mistake and you have to support it your lifetime