VirtualBox

Changeset 3435 in kBuild for trunk/src/kash/exec.c


Ignore:
Timestamp:
Sep 2, 2020 8:30:54 PM (4 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/exec.c

    r3057 r3435  
    9999
    100100
    101 STATIC void tryexec(shinstance *, char *, char **, char **, int, int);
     101STATIC void tryexec(shinstance *, char *, char **, char **, int);
    102102STATIC void execinterp(shinstance *, char **, char **);
    103103STATIC void printentry(shinstance *, struct tblentry *, int);
     
    118118
    119119SH_NORETURN_1 void
    120 shellexec(shinstance *psh, char **argv, char **envp, const char *path, int idx, int vforked)
     120shellexec(shinstance *psh, char **argv, char **envp, const char *path, int idx)
    121121{
    122122        char *cmdname;
     
    144144                cmdname = stalloc(psh, argv0len + 5);
    145145                strcpy(cmdname, argv0);
    146                 tryexec(psh, cmdname, argv, envp, vforked, has_ext);
     146                tryexec(psh, cmdname, argv, envp, has_ext);
    147147                TRACE((psh, "shellexec: cmdname=%s\n", cmdname));
    148148                stunalloc(psh, cmdname);
     
    165165                while ((cmdname = padvance(psh, &path, argv0)) != NULL) {
    166166                        if (--idx < 0 && psh->pathopt == NULL) {
    167                                 tryexec(psh, cmdname, argv, envp, vforked, has_ext);
     167                                tryexec(psh, cmdname, argv, envp, has_ext);
    168168                                if (errno != ENOENT && errno != ENOTDIR)
    169169                                        e = errno;
     
    185185                break;
    186186        }
    187         TRACE((psh, "shellexec failed for '%s', errno %d, vforked %d, suppressint %d\n",
    188                 argv[0], e, vforked, psh->suppressint ));
     187        TRACE((psh, "shellexec failed for '%s', errno %d, suppressint %d\n",
     188                argv[0], e, psh->suppressint ));
    189189        exerror(psh, EXEXEC, "%s: %s", argv[0], errmsg(psh, e, E_EXEC));
    190190        /* NOTREACHED */
     
    193193
    194194STATIC void
    195 tryexec(shinstance *psh, char *cmd, char **argv, char **envp, int vforked, int has_ext)
     195tryexec(shinstance *psh, char *cmd, char **argv, char **envp, int has_ext)
    196196{
    197197        int e;
     
    220220        e = errno;
    221221        if (e == ENOEXEC) {
    222                 if (vforked) {
    223                         /* We are currently vfork(2)ed, so raise an
    224                          * exception, and evalcommand will try again
    225                          * with a normal fork(2).
    226                          */
    227                         exraise(psh, EXSHELLPROC);
    228                 }
    229222                initshellproc(psh);
    230223                setinputfile(psh, cmd, 0);
     
    347340            /* nothing*/;
    348341        TRACE((psh, "hash bang '%s'\n", new[0]));
    349         shellexec(psh, new, envp, pathval(psh), 0, 0);
     342        shellexec(psh, new, envp, pathval(psh), 0);
    350343        /* NOTREACHED */
    351344}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette