]> git.sur5r.net Git - cc65/blobdiff - libsrc/common/signal.s
The spans do now contain the size of a span, no longer the end offset.
[cc65] / libsrc / common / signal.s
index e77674255921441b0fb0be15b518d1572d794230..9327ca89c33f55d820d5192a85c06d71279d1141 100644 (file)
@@ -38,6 +38,7 @@ _signal:
         asl     a               ; Prepare for word access
         tax
 
+        sei                     ; Disable interrupts in case of async signals
         lda     sigtable,x
         pha
         lda     ptr1
@@ -46,6 +47,7 @@ _signal:
         pha
         lda     ptr1+1
         sta     sigtable+1,x
+        cli                     ; Reenable interrupts
 
 ; Get the old value from the stack and return it
 
@@ -59,9 +61,7 @@ __sig_ign:
 
 invalidsig:
         lda     #<EINVAL
-        sta     __errno
-        lda     #>EINVAL        ; A = 0
-        sta     __errno+1
+        jsr     __seterrno      ; Returns 0 in A
         tax                     ; A/X = 0
 __sig_dfl:
         rts