Changeset 2282 for trunk/src


Ignore:
Timestamp:
Feb 24, 2009, 5:08:51 AM (16 years ago)
Author:
bird
Message:

kash: hacked signal delivery, some trap+kill tests.

Location:
trunk/src/kash
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/Makefile.kmk

    r2243 r2282  
    182182endif
    183183
     184# Include the sub-makefile.
     185include $(PATH_SUB_CURRENT)/tests/Makefile.kmk
     186
    184187include $(FILE_KBUILD_SUB_FOOTER)
    185188
     189
  • trunk/src/kash/shinstance.c

    r2243 r2282  
    347347static void sh_sig_common_handler(int signo)
    348348{
     349    shmtxtmp tmp;
     350    shinstance *psh;
     351
    349352    fprintf(stderr, "sh_sig_common_handler: signo=%d:%s\n", signo, sys_signame[signo]);
     353    shmtx_enter(&g_sh_mtx, &tmp);
     354
     355/** @todo signal focus chain or something? Atm there will only be one shell,
     356 *        so it's not really important until we go threaded for real... */
     357    psh = g_sh_tail;
     358    while (psh != NULL)
     359    {
     360        if (psh->sigactions[signo].sh_handler == SH_SIG_DFL)
     361            /* implement... */;
     362        else if (psh->sigactions[signo].sh_handler != SIG_IGN)
     363            psh->sigactions[signo].sh_handler(psh, signo);
     364
     365        psh = psh->prev;
     366    }
     367
     368    shmtx_leave(&g_sh_mtx, &tmp);
    350369}
    351370
     
    578597    rc = -1;
    579598# else
    580     //fprintf(stderr, "kill(%d, %d)\n", pid, signo);
     599    fprintf(stderr, "kill(%d, %d)\n", pid, signo);
    581600    rc = kill(pid, signo);
    582601# endif
Note: See TracChangeset for help on using the changeset viewer.