diff --git a/libc/system/signalcb.S b/libc/system/signalcb.S index 17ce5116f..4cf5b223c 100644 --- a/libc/system/signalcb.S +++ b/libc/system/signalcb.S @@ -20,7 +20,10 @@ _signal_cbhandler: push %dx push %si push %di + push %ds push %es + mov %ss,%ax + mov %ax,%ds mov 6(%bp),%bx #ifndef __IA16_CALLCVT_REGPARMCALL @@ -43,6 +46,7 @@ _signal_cbhandler: #endif pop %es + pop %ds pop %di pop %si pop %dx diff --git a/libc/watcom/asm/signalcb.asm b/libc/watcom/asm/signalcb.asm index 765956d22..ca0be81c3 100644 --- a/libc/watcom/asm/signalcb.asm +++ b/libc/watcom/asm/signalcb.asm @@ -20,6 +20,8 @@ __signal_cbhandler proc far push di push ds push es + mov ax,ss ; ensure valid DS (=SS) + mov ds,ax mov ax,6[bp] ; get signal # callf _signal_wchandler_ ; call user function from C