parent
1840ac795e
commit
90b5364b29
|
@ -3184,8 +3184,6 @@ process_edited_input (struct app_context *ctx)
|
||||||
print_error ("could not unlink `%s': %s",
|
print_error ("could not unlink `%s': %s",
|
||||||
ctx->editor_filename, strerror (errno));
|
ctx->editor_filename, strerror (errno));
|
||||||
|
|
||||||
free (ctx->editor_filename);
|
|
||||||
ctx->editor_filename = NULL;
|
|
||||||
str_free (&input);
|
str_free (&input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3203,7 +3201,7 @@ on_child (EV_P_ ev_child *handle, int revents)
|
||||||
kill (-handle->rpid, SIGKILL);
|
kill (-handle->rpid, SIGKILL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// I don't recognize this child (we should also check PID)
|
// I don't recognize this child (we should also check its PID)
|
||||||
if (!ctx->editor_filename)
|
if (!ctx->editor_filename)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -3216,6 +3214,9 @@ on_child (EV_P_ ev_child *handle, int revents)
|
||||||
print_error ("editor returned status %d", WEXITSTATUS (status));
|
print_error ("editor returned status %d", WEXITSTATUS (status));
|
||||||
else
|
else
|
||||||
process_edited_input (ctx);
|
process_edited_input (ctx);
|
||||||
|
|
||||||
|
free (ctx->editor_filename);
|
||||||
|
ctx->editor_filename = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -3250,8 +3251,14 @@ on_tty_readable (EV_P_ ev_io *handle, int revents)
|
||||||
{
|
{
|
||||||
// rl_callback_read_char() is not reentrant, may happen on EOF
|
// rl_callback_read_char() is not reentrant, may happen on EOF
|
||||||
ev_io_stop (EV_DEFAULT_ &ctx->tty_watcher);
|
ev_io_stop (EV_DEFAULT_ &ctx->tty_watcher);
|
||||||
|
|
||||||
ctx->input->vtable->on_tty_readable (ctx->input);
|
ctx->input->vtable->on_tty_readable (ctx->input);
|
||||||
ev_io_start (EV_DEFAULT_ &ctx->tty_watcher);
|
|
||||||
|
// Don't make ourselves receive a SIGTTIN. Ideally we'd prevent
|
||||||
|
// reentrancy without inciting conflicts with
|
||||||
|
// {suspend,resume}_terminal() but I can't figure anything out.
|
||||||
|
if (!ctx->editor_filename)
|
||||||
|
ev_io_start (EV_DEFAULT_ &ctx->tty_watcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue