"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/pty.c" between
rlwrap-0.45.tar.gz and rlwrap-0.45.1.tar.gz

About: rlwrap is a "readline wrapper" allowing the editing of keyboard input for any command.

pty.c  (rlwrap-0.45):pty.c  (rlwrap-0.45.1)
skipping to change at line 52 skipping to change at line 52
ptytty_openpty(&fdm, &fds, &slave_name); ptytty_openpty(&fdm, &fds, &slave_name);
block_signals(only_sigchld); /* block SIGCHLD until we have had a chance to i nstall a handler for it after the fork() */ block_signals(only_sigchld); /* block SIGCHLD until we have had a chance to i nstall a handler for it after the fork() */
fflush(NULL); fflush(NULL);
if ((pid = fork()) < 0) { if ((pid = fork()) < 0) {
myerror(FATAL|USE_ERRNO, "Cannot fork"); myerror(FATAL|USE_ERRNO, "Cannot fork");
return(42); /* the compiler may not know that myerror() won't return */ return(42); /* the compiler may not know that myerror() won't return */
} else if (pid == 0) { /* child */ } else if (pid == 0) { /* child */
DEBUG_RANDOM_SLEEP; DEBUG_RANDOM_SLEEP;
i_am_child = TRUE; /* remember who I am */ 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(); unblock_all_signals();
close(fdm); /* fdm not used in child */ close(fdm); /* fdm not used in child */
ptytty_control_tty(fds, slave_name); ptytty_control_tty(fds, slave_name);
if (dup2(fds, STDIN_FILENO) != STDIN_FILENO) /* extremely unlikely */ if (dup2(fds, STDIN_FILENO) != STDIN_FILENO) /* extremely unlikely */
myerror(FATAL|USE_ERRNO, "dup2 to stdin failed"); myerror(FATAL|USE_ERRNO, "dup2 to stdin failed");
if (isatty(STDOUT_FILENO) && dup2(fds, STDOUT_FILENO) != STDOUT_FILENO) if (isatty(STDOUT_FILENO) && dup2(fds, STDOUT_FILENO) != STDOUT_FILENO)
myerror(FATAL|USE_ERRNO, "dup2 to stdout failed"); myerror(FATAL|USE_ERRNO, "dup2 to stdout failed");
if (isatty(STDERR_FILENO) && dup2(fds, STDERR_FILENO) != STDERR_FILENO) if (isatty(STDERR_FILENO) && dup2(fds, STDERR_FILENO) != STDERR_FILENO)
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)