Changeset 3219 for trunk/src/kmk/kmkbuiltin/install.c
- Timestamp:
- Mar 31, 2018, 12:30:15 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/install.c
r3215 r3219 551 551 } 552 552 553 if (!devnull && (from_fd = open(from_name, O_RDONLY | O_BINARY , 0)) < 0)553 if (!devnull && (from_fd = open(from_name, O_RDONLY | O_BINARY | KMK_OPEN_NO_INHERIT, 0)) < 0) 554 554 return err(pThis->pCtx, EX_OSERR, "%s", from_name); 555 555 556 556 /* If we don't strip, we can compare first. */ 557 557 if (pThis->docompare && !pThis->dostrip && target) { 558 if ((to_fd = open(to_name, O_RDONLY | O_BINARY , 0)) < 0) {558 if ((to_fd = open(to_name, O_RDONLY | O_BINARY | KMK_OPEN_NO_INHERIT, 0)) < 0) { 559 559 rc = err(pThis->pCtx, EX_OSERR, "%s", to_name); 560 560 goto l_done; … … 613 613 close(to_fd); 614 614 #endif 615 to_fd = open(tempcopy ? tempfile : to_name, O_RDONLY | O_BINARY , 0);615 to_fd = open(tempcopy ? tempfile : to_name, O_RDONLY | O_BINARY | KMK_OPEN_NO_INHERIT, 0); 616 616 if (to_fd < 0) { 617 617 rc = err(pThis->pCtx, EX_OSERR, "stripping %s", to_name); … … 627 627 628 628 /* Re-open to_fd using the real target name. */ 629 if ((to_fd = open(to_name, O_RDONLY | O_BINARY , 0)) < 0) {629 if ((to_fd = open(to_name, O_RDONLY | O_BINARY | KMK_OPEN_NO_INHERIT, 0)) < 0) { 630 630 rc = err(pThis->pCtx, EX_OSERR, "%s", to_name); 631 631 goto l_done; … … 707 707 /* Re-open to_fd so we aren't hosed by the rename(2). */ 708 708 (void) close(to_fd); 709 if ((to_fd = open(to_name, O_RDONLY | O_BINARY , 0)) < 0) {709 if ((to_fd = open(to_name, O_RDONLY | O_BINARY | KMK_OPEN_NO_INHERIT, 0)) < 0) { 710 710 rc = err(pThis->pCtx, EX_OSERR, "%s", to_name); 711 711 goto l_done; … … 913 913 } 914 914 915 newfd = open(path, O_CREAT | O_RDWR | O_TRUNC | O_BINARY , S_IRUSR | S_IWUSR);915 newfd = open(path, O_CREAT | O_RDWR | O_TRUNC | O_BINARY | KMK_OPEN_NO_INHERIT, S_IRUSR | S_IWUSR); 916 916 if (newfd < 0 && saved_errno != 0) 917 917 errno = saved_errno;
Note:
See TracChangeset
for help on using the changeset viewer.