Changeset 3562
- Timestamp:
- Mar 8, 2022, 12:10:40 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/redirect.c
r3412 r3562 1418 1418 #ifdef USE_POSIX_SPAWN 1419 1419 /* 1420 * Init posix attributes .1420 * Init posix attributes with stdout/err redirections according to pCtx. 1421 1421 */ 1422 1422 rcExit = posix_spawn_file_actions_init(&FileActions); 1423 1423 if (rcExit != 0) 1424 1424 rcExit = errx(pCtx, 9, "posix_spawn_file_actions_init failed: %s", strerror(rcExit)); 1425 # ifndef CONFIG_WITH_OUTPUT_IN_MEMORY 1426 if (pCtx->pOut && rcExit == 0) 1427 { 1428 if (pCtx->pOut->out >= 0) 1429 { 1430 rcExit = posix_spawn_file_actions_adddup2(&FileActions, pCtx->pOut->out, 1); 1431 if (rcExit != 0) 1432 rcExit = errx(pCtx, 2, "posix_spawn_file_actions_addclose(%d, 1) failed: %s", pCtx->pOut->out, strerror(rcExit)); 1433 } 1434 if (pCtx->pOut->err >= 0 && rcExit == 0) 1435 { 1436 rcExit = posix_spawn_file_actions_adddup2(&FileActions, pCtx->pOut->err, 2); 1437 if (rcExit != 0) 1438 rcExit = errx(pCtx, 2, "posix_spawn_file_actions_addclose(%d, 1) failed: %s", pCtx->pOut->err, strerror(rcExit)); 1439 } 1440 } 1441 # endif 1425 1442 #endif 1426 1443 … … 1761 1778 rcExit = posix_spawn_file_actions_adddup2(&FileActions, fdSource, fd); 1762 1779 if (rcExit != 0) 1763 rcExit = errx(pCtx, 2, "posix_spawn_file_actions_addclose(%d) failed: %s", fd, strerror(rcExit)); 1780 rcExit = errx(pCtx, 2, "posix_spawn_file_actions_adddup2(%d) failed: %s", 1781 fdSource, fd, strerror(rcExit)); 1764 1782 #endif 1765 1783 }
Note:
See TracChangeset
for help on using the changeset viewer.