Skip to main content

enableshfuncnode

Function enableshfuncnode 

Source
pub fn enableshfuncnode(hn: &str)
Expand description

Port of enableshfuncnode(HashNode hn, UNUSED(int flags)) from Src/hashtable.c:873.

C body:

shf->node.flags &= ~DISABLED;
if (!strncmp(shf->node.nam, "TRAP", 4)) {
    int sigidx = getsigidx(shf->node.nam + 4);
    if (sigidx != -1) settrap(sigidx, NULL, ZSIG_FUNC);
}

Clears the DISABLED flag; for TRAP* functions, re-installs the signal handler with ZSIG_FUNC semantics so the shell dispatches the trap function on the next signal delivery. WARNING: param names don’t match C — Rust=(hn) vs C=(hn, flags)