Changeset 3433 for trunk/src/kash/redir.c
- Timestamp:
- Sep 2, 2020, 7:25:31 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/redir.c
r2648 r3433 243 243 } 244 244 245 #ifdef KASH_USE_FORKSHELL2 246 struct openherechild 247 { 248 int pip[2]; 249 size_t len; 250 }; 251 static int openhere_child(shinstance *psh, union node *n, void *argp) 252 { 253 struct openherechild args = *(struct openherechild *)argp; 254 255 shfile_close(&psh->fdtab, args.pip[0]); 256 sh_signal(psh, SIGINT, SH_SIG_IGN); 257 sh_signal(psh, SIGQUIT, SH_SIG_IGN); 258 sh_signal(psh, SIGHUP, SH_SIG_IGN); 259 # ifdef SIGTSTP 260 sh_signal(psh, SIGTSTP, SH_SIG_IGN); 261 # endif 262 sh_signal(psh, SIGPIPE, SH_SIG_DFL); 263 if (n->type == NHERE) 264 xwrite(psh, args.pip[1], n->nhere.doc->narg.text, args.len); 265 else 266 expandhere(psh, n->nhere.doc, args.pip[1]); 267 return 0; 268 } 269 270 #endif /* KASH_USE_FORKSHELL2*/ 245 271 246 272 /* … … 265 291 } 266 292 } 293 #ifdef KASH_USE_FORKSHELL2 294 { 295 struct openherechild args; 296 args.pip[0] = pip[0]; 297 args.pip[1] = pip[1]; 298 args.len = len; 299 forkshell2(psh, (struct job *)NULL, (union node *)NULL, FORK_NOJOB, 300 openhere_child, redir, &args, sizeof(args)); 301 } 302 #else 267 303 if (forkshell(psh, (struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) { 268 304 shfile_close(&psh->fdtab, pip[0]); … … 280 316 sh__exit(psh, 0); 281 317 } 318 #endif 282 319 out: 283 320 shfile_close(&psh->fdtab, pip[1]);
Note:
See TracChangeset
for help on using the changeset viewer.