ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/State.xs
(Generate patch)

Comparing Coro/Coro/State.xs (file contents):
Revision 1.337 by root, Fri Dec 5 18:26:10 2008 UTC vs.
Revision 1.338 by root, Sun Dec 7 15:33:21 2008 UTC

769#endif 769#endif
770 770
771/* 771/*
772 * This overrides the default magic get method of %SIG elements. 772 * This overrides the default magic get method of %SIG elements.
773 * The original one doesn't provide for reading back of PL_diehook/PL_warnhook 773 * The original one doesn't provide for reading back of PL_diehook/PL_warnhook
774 * and instead of tryign to save and restore the hash elements, we just provide 774 * and instead of trying to save and restore the hash elements, we just provide
775 * readback here. 775 * readback here.
776 * We only do this when the hook is != 0, as they are often set to 0 temporarily,
777 * not expecting this to actually change the hook. This is a potential problem
778 * when a schedule happens then, but we ignore this.
779 */ 776 */
780static int 777static int
781coro_sigelem_get (pTHX_ SV *sv, MAGIC *mg) 778coro_sigelem_get (pTHX_ SV *sv, MAGIC *mg)
782{ 779{
783 const char *s = MgPV_nolen_const (mg); 780 const char *s = MgPV_nolen_const (mg);
836 if (strEQ (s, "__WARN__")) svp = &PL_warnhook; 833 if (strEQ (s, "__WARN__")) svp = &PL_warnhook;
837 834
838 if (svp) 835 if (svp)
839 { 836 {
840 SV *old = *svp; 837 SV *old = *svp;
841 *svp = newSVsv (sv); 838 *svp = SvOK (sv) ? newSVsv (sv) : 0;
842 SvREFCNT_dec (old); 839 SvREFCNT_dec (old);
843 return 0; 840 return 0;
844 } 841 }
845 } 842 }
846 843

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines