Skip to content

Commit

Permalink
rlwrap would always open /tmp/rlwrap.debug after forking child command
Browse files Browse the repository at this point in the history
  • Loading branch information
hanslub42 committed May 19, 2021
1 parent d67ac37 commit 5aa2609
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ my_pty_fork(int *ptr_master_fd,
} else if (pid == 0) { /* child */
DEBUG_RANDOM_SLEEP;
i_am_child = TRUE; /* remember who I am */
my_fopen(&debug_fp, DEBUG_FILENAME, "a+", "debug log");
if (debug)
my_fopen(&debug_fp, DEBUG_FILENAME, "a+", "debug log");

unblock_all_signals();
close(fdm); /* fdm not used in child */
Expand Down

2 comments on commit 5aa2609

@jurajlutter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also applies to filter.c, term.c, utils.c. Also it should be enclosed in #ifdef DEBUG ... #endif, I guess.

@hanslub42
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The one in filter.c would indeed create an unintended /tmp/rlwrap.debug (fixed by 0f0e1b3) , but not the other ones.

Please sign in to comment.