Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sasl: make_tar/2 extrafiles option #8843

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions erts/emulator/sys/unix/erl_child_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ main(int argc, char *argv[])

SET_CLOEXEC(uds_fd);

if (isatty(0)) {
if (isatty(0) && isatty(1)) {
ssize_t res = read_all(uds_fd, (char*)&initial_tty_mode, sizeof(struct termios));
if (res <= 0) {
ABORT("Failed to read initial_tty_mode: %d (%d)", res, errno);
Expand Down Expand Up @@ -560,7 +560,7 @@ main(int argc, char *argv[])
pipes, 3, MSG_DONTWAIT)) < 0) {
if (errno == EINTR)
continue;
if (isatty(0)) {
if (isatty(0) && isatty(1)) {
tcsetattr(0,TCSANOW,&initial_tty_mode);
}
DEBUG_PRINT("erl_child_setup failed to read from uds: %d, %d", res, errno);
Expand All @@ -569,7 +569,7 @@ main(int argc, char *argv[])

if (res == 0) {
DEBUG_PRINT("uds was closed!");
if (isatty(0)) {
if (isatty(0) && isatty(1)) {
tcsetattr(0,TCSANOW,&initial_tty_mode);
}
_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/sys/unix/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void sys_tty_reset(int exit_code)
if (using_oldshell && !replace_intr) {
SET_BLOCKING(0);
}
else if (isatty(0)) {
else if (isatty(0) && isatty(1)) {
tcsetattr(0,TCSANOW,&erl_sys_initial_tty_mode);
}
}
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/sys/unix/sys_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ static ErlDrvData forker_start(ErlDrvPort port_num, char* name,
/* If stdin is a tty then we need to restore its settings when we exit.
So we send the tty mode to erl_child_setup so that it can cleanup
in case the emulator is terminated with SIGKILL. */
if (isatty(0)) {
if (isatty(0) && isatty(1)) {
ssize_t res, pos = 0;
size_t size = sizeof(struct termios);
byte *buff = (byte *)&erl_sys_initial_tty_mode;
Expand Down
6 changes: 2 additions & 4 deletions lib/sasl/src/systools.erl
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,7 @@ is specified, this path is appended to the current path. Wildcard `*` is
expanded to all matching directories. Example: `"lib/*/ebin"`.

If the `{extra_files, ExtraFiles}` option is given then the `ExtraFiles` are
added to the tarball after everything else to be included has been added. The
`ExtraFiles` list is a list of files or directories in the same format as the
`add_type()` tuple for [erl_tar:add/3,4](`erl_tar:add/3`)
added to the tarball after everything else to be included has been added.

Option `variables` can be used to specify an installation directory other than
`lib` for some of the applications. If variable `{VarName,Prefix}` is specified
Expand Down Expand Up @@ -293,7 +291,7 @@ described for [`make_script`](`make_script/1`).
App :: atom(),
Result :: ok | error | {ok, Module :: module(), Warnings :: term()} |
{error, Module :: module(), Error :: term()},
ExtraFiles :: [{NameInArchive, file:filename_all()}],
ExtraFiles :: [{file:filename_all(), NameInArchive}],
NameInArchive :: string().
make_tar(RelName, Opt) ->
systools_make:make_tar(RelName, Opt).
Expand Down
Loading