Changeset 3409 for trunk/src/kash/trap.c


Ignore:
Timestamp:
Aug 13, 2020, 11:49:06 AM (5 years ago)
Author:
bird
Message:

kash: Generate the signal names at compile time rather than lazily at runtime. This should be more efficient, though may cause trouble if cross building.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/trap.c

    r2298 r3409  
    5959#include "shinstance.h"
    6060
    61 #ifndef HAVE_SYS_SIGNAME
    62 extern void init_sys_signame(void);
    63 extern char sys_signame[NSIG][16];
    64 #endif
    6561
    6662/*
     
    10399                p += 3;
    104100
    105 #ifndef HAVE_SYS_SIGNAME
    106         init_sys_signame();
    107 #endif
    108101        for (i = 0; i < NSIG; ++i)
    109102                if (strcasecmp(p, sys_signame[i]) == 0)
     
    121114
    122115        out1str(psh, "EXIT ");
    123 #ifndef HAVE_SYS_SIGNAME
    124         init_sys_signame();
    125 #endif
    126116
    127117        for (n = 1; n < NSIG; n++) {
     
    144134        char **ap;
    145135        int signo;
    146 #ifndef HAVE_SYS_SIGNAME
    147         init_sys_signame();
    148 #endif
    149136
    150137        if (argc <= 1) {
Note: See TracChangeset for help on using the changeset viewer.