This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Additional changes to get C++ a little closer to a clean compile
[perl5.git] / ext / POSIX / POSIX.xs
index 730e7e0..3c7b0b8 100644 (file)
@@ -732,7 +732,7 @@ getlflag(termios_ref)
 cc_t
 getcc(termios_ref, ccix)
        POSIX::Termios  termios_ref
-       int             ccix
+       unsigned int    ccix
     CODE:
 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
        if (ccix >= NCCS)
@@ -802,7 +802,7 @@ setlflag(termios_ref, lflag)
 void
 setcc(termios_ref, ccix, cc)
        POSIX::Termios  termios_ref
-       int             ccix
+       unsigned int    ccix
        cc_t            cc
     CODE:
 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
@@ -1260,6 +1260,10 @@ sigaction(sig, optaction, oldaction = 0)
            SV** svp;
            SV** sigsvp;
 
+            if (sig < 0) {
+                croak("Negative signals are not allowed");
+            }
+
            if (sig == 0 && SvPOK(ST(0))) {
                const char *s = SvPVX_const(ST(0));
                int i = whichsig(s);
@@ -1359,7 +1363,7 @@ sigaction(sig, optaction, oldaction = 0)
                svp = hv_fetchs(action, "SAFE", FALSE);
                act.sa_handler =
                        DPTR2FPTR(
-                           void (*)(),
+                           void (*)(int),
                            (*svp && SvTRUE(*svp))
                                ? PL_csighandlerp : PL_sighandlerp
                        );