Changeset 3458 in kBuild
- Timestamp:
- Sep 14, 2020 9:46:32 PM (5 years ago)
- Location:
- trunk/src/kash
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/Makefile.kmk
r3457 r3458 36 36 kash_NAME = kmk_ash 37 37 kash_ASTOOL = YASM 38 kash_DEFS = lint SHELL SMALL #KASH_SEPARATE_PARSER_ALLOCATOR38 kash_DEFS = lint SHELL SMALL KASH_SEPARATE_PARSER_ALLOCATOR 39 39 if "$(KBUILD_TARGET)" != "win" || defined(KASH_WIN_FORKED_MODE) 40 40 kash_DEFS += SH_FORKED_MODE 41 else 42 kash_DEFS += KASH_SEPARATE_PARSER_ALLOCATOR 41 43 endif 42 44 kash_DEFS.debug = DEBUG=2 -
trunk/src/kash/eval.c
r3455 r3458 1112 1112 (flags != EV_BACKCMD as EV_EXIT is ORed in). */ 1113 1113 1114 /* If cmdentry references an internal function, we must duplicates it's nodes. */1114 /* If cmdentry references an internal function, we must duplicates (reference) it's nodes. */ 1115 1115 if (args->cmdentry.cmdtype == CMDFUNCTION) 1116 1116 args->cmdentry.u.func = copyparsetree(pshchild, args->cmdentry.u.func); /** @todo isn't this duplicated already? */ -
trunk/src/kash/generated/nodes.c
r3449 r3458 51 51 #include "shinstance.h" 52 52 53 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 53 54 54 55 size_t funcblocksize; /* size of structures in function */ … … 93 94 STATIC char *nodesavestr(char *); 94 95 96 #endif /* !KASH_SEPARATE_PARSER_ALLOCATOR */ 95 97 96 98 … … 104 106 union node *n; 105 107 { 108 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 109 if (n != NULL) { 110 unsigned refs = pstackretain(n->pblock); 111 TRACE2((psh, "copyfunc: %p - %u refs\n", n->pblock, refs)); K_NOREF(refs); 112 } 113 return n; 114 #else 106 115 if (n == NULL) 107 116 return NULL; … … 112 121 funcstring = (char *) funcblock + funcblocksize; 113 122 return copynode(n); 114 } 115 116 123 #endif 124 } 125 126 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 117 127 118 128 STATIC void … … 274 284 case NAPPEND: 275 285 new->nfile.fname = copynode(n->nfile.fname); 286 new->nfile.next = copynode(n->nfile.next); 276 287 new->nfile.fd = n->nfile.fd; 277 new->nfile.next = copynode(n->nfile.next);278 288 break; 279 289 case NTOFD: … … 281 291 new->ndup.vname = copynode(n->ndup.vname); 282 292 new->ndup.dupfd = n->ndup.dupfd; 293 new->ndup.next = copynode(n->ndup.next); 283 294 new->ndup.fd = n->ndup.fd; 284 new->ndup.next = copynode(n->ndup.next);285 295 break; 286 296 case NHERE: 287 297 case NXHERE: 288 298 new->nhere.doc = copynode(n->nhere.doc); 299 new->nhere.next = copynode(n->nhere.next); 289 300 new->nhere.fd = n->nhere.fd; 290 new->nhere.next = copynode(n->nhere.next);291 301 break; 292 302 case NNOT: … … 335 345 } 336 346 347 #endif /* !KASH_SEPARATE_PARSER_ALLOCATOR */ 337 348 338 349 … … 343 354 void 344 355 freefunc(psh, n) 345 shinstance *psh;356 shinstance *psh; 346 357 union node *n; 347 358 { 359 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 360 if (n) 361 pstackrelease(psh, n->pblock, "freefunc"); 362 #else 348 363 if (n) 349 364 ckfree(psh, n); 350 } 365 #endif 366 } -
trunk/src/kash/generated/nodes.h
r3449 r3458 33 33 34 34 struct nbinary { 35 int type; 36 union node *ch1; 37 union node *ch2; 35 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 36 struct pstack_block *pblock; 37 #endif 38 int type; 39 union node *ch1; 40 union node *ch2; 38 41 }; 39 42 40 43 41 44 struct ncmd { 42 int type; 43 int backgnd; 44 union node *args; 45 union node *redirect; 45 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 46 struct pstack_block *pblock; 47 #endif 48 int type; 49 int backgnd; 50 union node *args; 51 union node *redirect; 46 52 }; 47 53 48 54 49 55 struct npipe { 50 int type; 51 int backgnd; 52 struct nodelist *cmdlist; 56 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 57 struct pstack_block *pblock; 58 #endif 59 int type; 60 int backgnd; 61 struct nodelist *cmdlist; 53 62 }; 54 63 55 64 56 65 struct nredir { 57 int type; 58 union node *n; 59 union node *redirect; 66 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 67 struct pstack_block *pblock; 68 #endif 69 int type; 70 union node *n; 71 union node *redirect; 60 72 }; 61 73 62 74 63 75 struct nif { 64 int type; 65 union node *test; 66 union node *ifpart; 67 union node *elsepart; 76 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 77 struct pstack_block *pblock; 78 #endif 79 int type; 80 union node *test; 81 union node *ifpart; 82 union node *elsepart; 68 83 }; 69 84 70 85 71 86 struct nfor { 72 int type; 73 union node *args; 74 union node *body; 75 char *var; 87 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 88 struct pstack_block *pblock; 89 #endif 90 int type; 91 union node *args; 92 union node *body; 93 char *var; 76 94 }; 77 95 78 96 79 97 struct ncase { 80 int type; 81 union node *expr; 82 union node *cases; 98 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 99 struct pstack_block *pblock; 100 #endif 101 int type; 102 union node *expr; 103 union node *cases; 83 104 }; 84 105 85 106 86 107 struct nclist { 87 int type; 88 union node *next; 89 union node *pattern; 90 union node *body; 108 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 109 struct pstack_block *pblock; 110 #endif 111 int type; 112 union node *next; 113 union node *pattern; 114 union node *body; 91 115 }; 92 116 93 117 94 118 struct narg { 95 int type; 96 union node *next; 97 char *text; 98 struct nodelist *backquote; 119 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 120 struct pstack_block *pblock; 121 #endif 122 int type; 123 union node *next; 124 char *text; 125 struct nodelist *backquote; 99 126 }; 100 127 101 128 102 129 struct nfile { 103 int type; 104 int fd; 105 union node *next; 106 union node *fname; 130 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 131 struct pstack_block *pblock; 132 #endif 133 int type; 134 int fd; 135 union node *next; 136 union node *fname; 107 137 }; 108 138 109 139 110 140 struct ndup { 111 int type; 112 int fd; 113 union node *next; 114 int dupfd; 115 union node *vname; 141 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 142 struct pstack_block *pblock; 143 #endif 144 int type; 145 int fd; 146 union node *next; 147 int dupfd; 148 union node *vname; 116 149 }; 117 150 118 151 119 152 struct nhere { 120 int type; 121 int fd; 122 union node *next; 123 union node *doc; 153 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 154 struct pstack_block *pblock; 155 #endif 156 int type; 157 int fd; 158 union node *next; 159 union node *doc; 124 160 }; 125 161 126 162 127 163 struct nnot { 128 int type; 129 union node *com; 164 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 165 struct pstack_block *pblock; 166 #endif 167 int type; 168 union node *com; 130 169 }; 131 170 132 171 133 172 union node { 134 int type; 135 struct nbinary nbinary; 136 struct ncmd ncmd; 137 struct npipe npipe; 138 struct nredir nredir; 139 struct nif nif; 140 struct nfor nfor; 141 struct ncase ncase; 142 struct nclist nclist; 143 struct narg narg; 144 struct nfile nfile; 145 struct ndup ndup; 146 struct nhere nhere; 147 struct nnot nnot; 173 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 174 # ifdef __GNUC__ 175 __extension__ 176 # endif 177 struct { 178 struct pstack_block *pblock; 179 int type; 180 }; 181 #else 182 int type; 183 #endif 184 struct nbinary nbinary; 185 struct ncmd ncmd; 186 struct npipe npipe; 187 struct nredir nredir; 188 struct nif nif; 189 struct nfor nfor; 190 struct ncase ncase; 191 struct nclist nclist; 192 struct narg narg; 193 struct nfile nfile; 194 struct ndup ndup; 195 struct nhere nhere; 196 struct nnot nnot; 148 197 }; 149 198 -
trunk/src/kash/memalloc.c
r3457 r3458 207 207 208 208 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 209 assert(mark->pstacksize <= psh->pstacksize); 210 while (mark->pstacksize < psh->pstacksize) { 211 unsigned idx = --psh->pstacksize; 212 pstack_block *psk = psh->pstack[idx]; 213 psh->pstack[idx] = NULL; 214 if (psh->curpstack == psk) 215 psh->curpstack = idx > 0 ? psh->pstack[idx - 1] : NULL; 216 pstackrelease(psh, psk); 217 } 218 219 # ifndef NDEBUG 220 if (psh->curpstack) { 221 unsigned i; 222 for (i = 0; i < psh->pstacksize; i++) 223 if (psh->curpstack == psh->pstack[i]) 224 break; 225 assert(i < psh->pstacksize); 226 } 227 # endif 209 pstackpop(psh, mark->pstacksize); 228 210 #endif 229 211 INTON; … … 382 364 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 383 365 384 unsigned pstackretain(pstack_block *pst) 385 { 386 unsigned refs = sh_atomic_inc(&pst->refs); 387 assert(refs > 1); 388 assert(refs < 256 /* bogus, but useful */); 389 return refs; 390 } 391 392 unsigned pstackrelease(shinstance *psh, pstack_block *pst) 366 unsigned pstackrelease(shinstance *psh, pstack_block *pst, const char *caller) 393 367 { 394 368 unsigned refs; 395 369 if (pst) { 396 370 refs = sh_atomic_dec(&pst->refs); 371 TRACE2((NULL, "pstackrelease: %p - %u refs (%s)\n", pst, refs, caller)); K_NOREF(caller); 397 372 if (refs == 0) { 398 373 shinstance * const psh = shthread_get_shell(); … … 407 382 pst->nextbyte = NULL; 408 383 pst->top = NULL; 384 /** @todo push into an alloc cache rather than freeing it */ 409 385 sh_free(psh, pst); 410 386 } … … 414 390 } 415 391 416 pstack_block *pstackpush(shinstance *psh) 392 void pstackpop(shinstance *psh, unsigned target) 393 { 394 assert(target <= psh->pstacksize); 395 while (target < psh->pstacksize) { 396 unsigned idx = --psh->pstacksize; 397 pstack_block *psk = psh->pstack[idx]; 398 psh->pstack[idx] = NULL; 399 if (psh->curpstack == psk) 400 psh->curpstack = idx > 0 ? psh->pstack[idx - 1] : NULL; 401 pstackrelease(psh, psk, "popstackmark"); 402 } 403 404 # ifndef NDEBUG 405 if (psh->curpstack) { 406 unsigned i; 407 for (i = 0; i < psh->pstacksize; i++) 408 if (psh->curpstack == psh->pstack[i]) 409 break; 410 assert(i < psh->pstacksize); 411 } 412 # endif 413 } 414 415 416 unsigned pstackretain(pstack_block *pst) 417 { 418 unsigned refs = sh_atomic_inc(&pst->refs); 419 assert(refs > 1); 420 assert(refs < 256 /* bogus, but useful */); 421 return refs; 422 } 423 424 K_INLINE void pstackpush(shinstance *psh, pstack_block *pst) 425 { 426 unsigned i = psh->pstacksize; 427 if (i + 1 < psh->pstackalloced) { 428 /* likely, except for the first time */ 429 } else { 430 psh->pstack = (pstack_block **)ckrealloc(psh, psh->pstack, sizeof(psh->pstack[0]) * (i + 32)); 431 memset(&psh->pstack[i], 0, sizeof(psh->pstack[0]) * 32); 432 } 433 psh->pstack[i] = pst; 434 psh->pstacksize = i + 1; 435 } 436 437 /* Does not make it current! */ 438 unsigned pstackretainpush(shinstance *psh, pstack_block *pst) 439 { 440 unsigned refs = pstackretain(pst); 441 pstackpush(psh, pst); 442 TRACE2((psh, "pstackretainpush: %p - entry %u - %u refs\n", pst, psh->pstacksize - 1, refs)); 443 return refs; 444 } 445 446 pstack_block *pstackallocpush(shinstance *psh) 417 447 { 418 448 size_t const blocksize = offsetof(pstack_block, first.space) + MINSIZE; 419 449 pstack_block *pst; 420 unsigned i;421 450 422 451 INTOFF; … … 443 472 444 473 /* 445 * Push it onto the stack .474 * Push it onto the stack and make it current. 446 475 */ 447 i = psh->pstacksize; 448 if (i + 1 < psh->pstackalloced) { 449 /* likely, except for the first time */ 450 } else { 451 psh->pstack = (pstack_block **)ckrealloc(psh, psh->pstack, sizeof(psh->pstack[0]) * (i + 32)); 452 memset(&psh->pstack[i], 0, sizeof(psh->pstack[0]) * 32); 453 } 454 psh->pstack[i] = pst; 455 psh->pstacksize = i + 1; 476 pstackpush(psh, pst); 456 477 psh->curpstack = pst; 457 478 458 479 INTON; 480 TRACE2((psh, "pstackallocpush: %p - entry %u\n", pst, psh->pstacksize - 1)); 459 481 return pst; 460 482 } … … 565 587 { 566 588 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 567 pstack_block *pst = psh->curpstack; 589 pstack_block * const pst = psh->curpstack; 590 union node * const ret = (union node *)pstallocint(psh, pst, nbytes); 568 591 pst->nodesalloced++; 569 return (union node *)pstallocint(psh, pst, nbytes); 592 ret->pblock = pst; 593 return ret; 570 594 #else 571 595 return (union node *)pstalloc(psh, nbytes); -
trunk/src/kash/memalloc.h
r3457 r3458 90 90 struct pstack_block; 91 91 unsigned pstackretain(struct pstack_block *); 92 unsigned pstackrelease(struct shinstance *, struct pstack_block *); 93 struct pstack_block *pstackpush(struct shinstance *); 92 void pstackpop(struct shinstance *, unsigned); 93 unsigned pstackrelease(struct shinstance *, struct pstack_block *, const char *); 94 unsigned pstackretainpush(struct shinstance *, struct pstack_block *); 95 struct pstack_block *pstackallocpush(struct shinstance *); 94 96 #endif 95 97 void *pstalloc(struct shinstance *, size_t); -
trunk/src/kash/mknodes.sh
r3449 r3458 73 73 echo 74 74 75 ## @todo inconsistent indentation here. 75 76 IFS=' ' 76 77 for struct in $struct_list; do … … 78 79 echo 79 80 echo "struct $struct {" 81 echo "#ifdef KASH_SEPARATE_PARSER_ALLOCATOR" 82 echo " struct pstack_block *pblock;" 83 echo "#endif" 80 84 field=0 81 85 while … … 94 98 * ) name=; shift 2; type="$*";; 95 99 esac 96 echo " 100 echo " $type$name;" 97 101 done 98 102 echo "};" … … 102 106 echo 103 107 echo "union node {" 104 echo " int type;" 108 echo "#ifdef KASH_SEPARATE_PARSER_ALLOCATOR" 109 echo "# ifdef __GNUC__" 110 echo " __extension__" 111 echo "# endif" 112 echo " struct {" 113 echo " struct pstack_block *pblock;" 114 echo " int type;" 115 echo " };" 116 echo "#else" 117 echo " int type;" 118 echo "#endif" 105 119 for struct in $struct_list; do 106 echo " 120 echo " struct $struct $struct;" 107 121 done 108 122 echo "};" -
trunk/src/kash/nodes.c.pat
r2391 r3458 47 47 #include "shinstance.h" 48 48 49 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 49 50 50 51 size_t funcblocksize; /* size of structures in function */ … … 62 63 STATIC char *nodesavestr(char *); 63 64 65 #endif /* !KASH_SEPARATE_PARSER_ALLOCATOR */ 64 66 65 67 … … 73 75 union node *n; 74 76 { 77 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 78 if (n != NULL) { 79 unsigned refs = pstackretain(n->pblock); 80 TRACE2((psh, "copyfunc: %p - %u refs\n", n->pblock, refs)); K_NOREF(refs); 81 } 82 return n; 83 #else 75 84 if (n == NULL) 76 85 return NULL; … … 81 90 funcstring = (char *) funcblock + funcblocksize; 82 91 return copynode(n); 92 #endif 83 93 } 84 94 85 95 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 86 96 87 97 STATIC void … … 154 164 } 155 165 166 #endif /* !KASH_SEPARATE_PARSER_ALLOCATOR */ 156 167 157 168 … … 165 176 union node *n; 166 177 { 178 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 179 if (n) 180 pstackrelease(psh, n->pblock, "freefunc"); 181 #else 167 182 if (n) 168 183 ckfree(psh, n); 184 #endif 169 185 } -
trunk/src/kash/parser.c
r3457 r3458 136 136 TRACE2((psh, "parsecmd(%d)\n", interact)); 137 137 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 138 pstack push(psh);138 pstackallocpush(psh); 139 139 #endif 140 140 psh->tokpushback = 0; … … 1788 1788 } 1789 1789 1790 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 1791 1790 1792 static union node *copyparsetreeint(shinstance *psh, union node *src); 1791 1793 … … 1947 1949 } 1948 1950 1951 #endif 1952 1949 1953 union node *copyparsetree(shinstance *psh, union node *src) 1950 1954 { 1951 1955 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 1952 pstackpush(psh); 1956 K_NOREF(psh); 1957 pstackretainpush(psh, src->pblock); 1958 return src; 1959 #else 1960 return copyparsetreeint(psh, src); 1953 1961 #endif 1954 return copyparsetreeint(psh, src); 1955 } 1956 1962 } 1963 -
trunk/src/kash/shfile.c
r3454 r3458 921 921 * Safe to call more than once. 922 922 */ 923 void shfile_uninit(shfdtab *pfdtab )923 void shfile_uninit(shfdtab *pfdtab, int tracefd) 924 924 { 925 925 if (!pfdtab) … … 930 930 unsigned left = pfdtab->size; 931 931 struct shfile *pfd = pfdtab->tab; 932 unsigned tracefdfound = 0; 932 933 while (left-- > 0) 933 934 { 934 935 if (pfd->fd != -1) 935 936 { 937 if (pfd->fd != tracefd) 938 { 936 939 #if K_OS == K_OS_WINDOWS 937 BOOL rc = CloseHandle((HANDLE)pfd->native); 938 assert(rc == TRUE); K_NOREF(rc); 939 #else 940 int rc = close((int)pfd->native); 941 assert(rc == 0); K_NOREF(rc); 942 #endif 943 pfd->fd = -1; 944 pfd->native = -1; 940 BOOL rc = CloseHandle((HANDLE)pfd->native); 941 assert(rc == TRUE); K_NOREF(rc); 942 #else 943 int rc = close((int)pfd->native); 944 assert(rc == 0); K_NOREF(rc); 945 #endif 946 pfd->fd = -1; 947 pfd->native = -1; 948 } 949 else 950 tracefdfound++; /* there is only the one */ 945 951 } 946 952 pfd++; 947 953 } 954 955 if (!tracefdfound) 956 { /* likely */ } 957 else 958 return; 948 959 949 960 sh_free(NULL, pfdtab->tab); -
trunk/src/kash/shfile.h
r3447 r3458 132 132 133 133 int shfile_init(shfdtab *, shfdtab *); 134 void shfile_uninit(shfdtab * );134 void shfile_uninit(shfdtab *, int); 135 135 void shfile_fork_win(shfdtab *pfdtab, int set, intptr_t *hndls); 136 136 typedef struct shfdexecwin -
trunk/src/kash/shinstance.c
r3451 r3458 44 44 #include "error.h" 45 45 #include "memalloc.h" 46 #include "nodes.h" 46 47 #include "redir.h" 47 48 #include "shell.h" … … 274 275 unsigned left, i; 275 276 277 INTOFF; 278 276 279 sh_int_unlink(psh); 277 shfile_uninit(&psh->fdtab );280 shfile_uninit(&psh->fdtab, psh->tracefd); 278 281 sh_free_string_vector(psh, &psh->shenviron); 279 282 … … 328 331 struct arglist exparg; /**< holds expanded arg list */ 329 332 char *expdir; /**< Used by expandmeta. */ 330 331 /* exec.h */ 332 const char *pathopt; /**< set by padvance */ 333 334 /* exec.c */ 335 struct tblentry *cmdtable[CMDTABLESIZE]; 336 int builtinloc/* = -1*/; /**< index in path of %builtin, or -1 */ 337 333 #endif 334 335 /* exec.h/exec.c */ 336 psh->pathopt = NULL; 337 for (i = 0; i < CMDTABLESIZE; i++) 338 { 339 struct tblentry *cur = psh->cmdtable[i]; 340 if (cur) 341 { 342 do 343 { 344 struct tblentry *next = cur->next; 345 if (cur->cmdtype == CMDFUNCTION) 346 { 347 freefunc(psh, cur->param.func); 348 cur->param.func = NULL; 349 } 350 sh_free(psh, cur); 351 cur = next; 352 } while (cur); 353 psh->cmdtable[i] = NULL; 354 } 355 } 356 357 #if 0 338 358 /* input.h */ 339 359 int plinno/* = 1 */;/**< input line number */ … … 382 402 int sstrnleft; 383 403 int herefd/* = -1 */; 384 385 /* memalloc.c */386 struct stack_block stackbase;387 struct stack_block *stackp/* = &stackbase*/;388 struct stackmark *markp;389 404 390 405 /* myhistedit.h */ … … 491 506 #endif 492 507 493 /** @todo finish this... */ 508 /* 509 * memalloc.c: Make sure we've gotten rid of all the stack memory. 510 */ 511 if (psh->stackp != &psh->stackbase && psh->stackp) 512 { 513 struct stack_block *stackp = psh->stackp; 514 do 515 { 516 psh->stackp = stackp->prev; 517 sh_free(psh, stackp); 518 } while ((stackp = psh->stackp) != &psh->stackbase && stackp); 519 } 520 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR //bp msvcr100!_wassert 521 if (psh->pstack) 522 { 523 if (psh->pstacksize > 0) 524 pstackpop(psh, 0); 525 sh_free(psh, psh->pstack); 526 psh->pstack = NULL; 527 } 528 #endif 529 psh->markp = NULL; 530 531 532 /* 533 * Finally get rid of tracefd and then free the shell: 534 */ 535 shfile_uninit(&psh->fdtab, -1); 536 494 537 memset(psh, 0, sizeof(*psh)); 495 538 sh_free(NULL, psh); … … 673 716 { 674 717 /* 718 * Make sure we can use TRACE/TRACE2 for logging here. 719 */ 720 #ifdef DEBUG 721 /* show.c */ 722 psh->tracefd = inherit->tracefd; 723 /* options.c */ 724 debug(psh) = debug(inherit); 725 #endif 726 727 /* 675 728 * Do the rest of the inheriting. 676 729 */ … … 743 796 /* redir.c */ 744 797 subshellinitredir(psh, inherit); 745 746 /* show.c */747 psh->tracefd = inherit->tracefd;748 798 749 799 /* trap.h / trap.c */ /** @todo we don't carry pendingsigs to the subshell, right? */ … … 1663 1713 { 1664 1714 TRACE2((psh, "sh__exit: %u shells around, must wait...\n", g_num_shells)); 1665 shfile_uninit(&psh->fdtab );1715 shfile_uninit(&psh->fdtab, psh->tracefd); 1666 1716 sh_int_unlink(psh); 1667 1717 /** @todo */
Note:
See TracChangeset
for help on using the changeset viewer.