Commit ec929c24 authored by Niels Möller's avatar Niels Möller
Browse files

* src/unix_interact.c (make_unix_interact): Install signal handler

only if backend is non-NULL.

Rev: src/unix_interact.c:1.2
parent 845e7c4f
......@@ -167,16 +167,16 @@ unix_read_password(struct interact *s UNUSED,
prompt = make_cstring(prompt, free);
if (!prompt)
return 0;
return NULL;
/* NOTE: This function uses a static buffer. */
password = getpass(prompt->data);
lsh_string_free(prompt);
if (!password)
return 0;
if (!password)
return NULL;
return format_cstring(password);
}
......@@ -376,7 +376,7 @@ make_unix_interact(struct io_backend *backend)
self->tty_fd = open("/dev/tty", O_RDWR);
#endif
if (self->tty_fd >= 0)
if (backend && (self->tty_fd >= 0))
{
/* Track window changes. */
struct sigaction winch;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment