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


Ignore:
Timestamp:
Sep 2, 2020, 10:30:54 PM (5 years ago)
Author:
bird
Message:

kash: Remove vfork code, we've never used it and we wont need it if we replace fork() with pthreads.

File:
1 edited

Legend:

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

    r3434 r3435  
    773773 *      evalcommand_out, evalcommand_parent, evalcommand_doit, evalcommand_child
    774774 */
    775 /*int vforked = 0;*/
     775/*int vforked = 0; - obsolete */
    776776
    777777/* Both child and parent exits thru here. */
     
    983983                        trputs(psh, "normal command:  ");  trargs(psh, args->argv);
    984984#endif
    985                         clearredir(psh, psh->vforked);
    986                         redirect(psh, cmd->ncmd.redirect, psh->vforked ? REDIR_VFORK : 0);
    987                         if (!psh->vforked)
    988                                 for (sp = args->varlist.list ; sp ; sp = sp->next)
    989                                         setvareq(psh, sp->text, VEXPORT|VSTACK);
     985                        clearredir(psh);
     986                        redirect(psh, cmd->ncmd.redirect, 0);
     987                        for (sp = args->varlist.list ; sp ; sp = sp->next)
     988                                setvareq(psh, sp->text, VEXPORT|VSTACK);
    990989                        envp = environment(psh);
    991                         shellexec(psh, args->argv, envp, args->path, args->cmdentry.u.index, psh->vforked);
     990                        shellexec(psh, args->argv, envp, args->path, args->cmdentry.u.index);
    992991                        break;
    993992                }
     
    10141013        const char *path = pathval(psh);
    10151014
    1016         psh->vforked = 0;
    10171015        /* First expand the arguments. */
    10181016        TRACE((psh, "evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
     
    11531151
    11541152                if (flags & EV_BACKCMD) {
    1155                         if (!psh->vforked) {
    1156                                 FORCEINTON;
    1157                         }
     1153                        FORCEINTON;
    11581154                        shfile_close(&psh->fdtab, pip[0]);
    11591155                        if (pip[1] != 1) {
     
    13041300                for (sp = psh->cmdenviron; sp; sp = sp->next)
    13051301                        setvareq(psh, sp->text, VEXPORT|VSTACK);
    1306                 shellexec(psh, argv + 1, environment(psh), pathval(psh), 0, 0);
     1302                shellexec(psh, argv + 1, environment(psh), pathval(psh), 0);
    13071303        }
    13081304        return 0;
Note: See TracChangeset for help on using the changeset viewer.