Changeset 3438 for trunk/src/kash/eval.c


Ignore:
Timestamp:
Sep 9, 2020, 10:01:39 PM (5 years ago)
Author:
bird
Message:

kash: Hammering on threaded mode.

File:
1 edited

Legend:

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

    r3437 r3438  
    225225        psh->displayhist = 1;   /* show history substitutions done with fc */
    226226#endif
    227         TRACE((psh, "pid %d, evaltree(%p: %d, %d) called\n",
     227        TRACE((psh, "pid %" SHPID_PRI ", evaltree(%p: %d, %d) called\n",
    228228               sh_getpid(psh), n, n->type, flags));
    229229        switch (n->type) {
     
    458458                args.backgnd = backgnd;
    459459                forkshell2(psh, jp, n, backgnd ? FORK_BG : FORK_FG,
    460                            evalsubshell_child, n, &args, sizeof(args), NULL);
     460                           evalsubshell_child, n, &args, sizeof(args), NULL);
    461461        }
    462462#else
     
    578578                        args.pip[1] = pip[1];
    579579                        forkshell2(psh, jp, lp->n, n->npipe.backgnd ? FORK_BG : FORK_FG,
    580                                    evalpipe_child, lp->n, &args, sizeof(args), NULL);
     580                                   evalpipe_child, lp->n, &args, sizeof(args), NULL);
    581581                }
    582582#else
     
    677677                        args.pip[1] = pip[1];
    678678                        forkshell2(psh, jp, n, FORK_NOJOB,
    679                                    evalbackcmd_child, n, &args, sizeof(args), NULL);
     679                                   evalbackcmd_child, n, &args, sizeof(args), NULL);
    680680                }
    681681#else
     
    894894                        volatile int temp_path = 0;
    895895                        char *volatile savecmdname;
     896                        int volatile savecmdnamemalloc;
    896897                        volatile int e;
    897898                        int mode;
     
    909910                        savehandler = psh->handler;
    910911                        savecmdname = psh->commandname;
     912                        savecmdnamemalloc = psh->commandnamemalloc;
    911913                        psh->handler = &jmploc;
    912914                        if (!setjmp(jmploc.loc)) {
     
    930932                                listsetvar(psh, args->varlist.list,
    931933                                        args->cmdentry.cmdtype == CMDSPLBLTIN ? 0 : VNOSET);
     934                                psh->commandnamemalloc = 0;
    932935                                psh->commandname = args->argv[0];
    933936                                /* initialize nextopt */
     
    962965                        if (e != EXSHELLPROC) {
    963966                                psh->commandname = savecmdname;
     967                                psh->commandnamemalloc = savecmdnamemalloc;
    964968                                if (args->flags & EV_EXIT)
    965969                                        exitshell(psh, psh->exitstatus);
    966970                        }
     971                        if (savecmdnamemalloc)
     972                                sh_free(psh, savecmdname);
    967973                        if (e != -1) {
    968974                                if ((e != EXERROR && e != EXEXEC)
Note: See TracChangeset for help on using the changeset viewer.