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/redir.c

    r3433 r3435  
    114114        memory[1] = flags & REDIR_BACKQ;
    115115        if (flags & REDIR_PUSH) {
    116                 /* We don't have to worry about REDIR_VFORK here, as
    117                  * flags & REDIR_PUSH is never true if REDIR_VFORK is set.
    118                  */
    119116                sv = ckmalloc(psh, sizeof (struct redirtab));
    120117                for (i = 0 ; i < 10 ; i++)
     
    174171        char *fname;
    175172        int f;
    176         int oflags = O_WRONLY|O_CREAT|O_TRUNC, eflags;
     173        int oflags = O_WRONLY|O_CREAT|O_TRUNC;
    177174
    178175        /*
     
    186183        case NFROM:
    187184                fname = redir->nfile.expfname;
    188                 if (flags & REDIR_VFORK)
    189                         eflags = O_NONBLOCK;
    190                 else
    191                         eflags = 0;
    192                 if ((f = shfile_open(&psh->fdtab, fname, O_RDONLY|eflags, 0)) < 0)
     185                if ((f = shfile_open(&psh->fdtab, fname, O_RDONLY, 0)) < 0)
    193186                        goto eopen;
    194                 if (eflags)
    195                         (void)shfile_fcntl(&psh->fdtab, f, F_SETFL, shfile_fcntl(&psh->fdtab, f, F_GETFL, 0) & ~eflags);
    196187                break;
    197188        case NFROMTO:
     
    365356
    366357SHELLPROC {
    367         clearredir(psh, 0);
     358        clearredir(psh);
    368359}
    369360
     
    381372
    382373void
    383 clearredir(shinstance *psh, int vforked)
     374clearredir(shinstance *psh)
    384375{
    385376        struct redirtab *rp;
     
    391382                                shfile_close(&psh->fdtab, rp->renamed[i]);
    392383                        }
    393                         if (!vforked)
    394                                 rp->renamed[i] = EMPTY;
     384                        rp->renamed[i] = EMPTY;
    395385                }
    396386        }
Note: See TracChangeset for help on using the changeset viewer.