diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-04-15 22:13:14 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-04-15 22:13:14 -0400 |
commit | ac3bd2e71c0cba44148cf41161b36436e4ce5a26 (patch) | |
tree | 79d75b52915acc612f230480f27ac267f62545d4 | |
parent | 6d214b44d9f150d82c84008fda8d4e4c2f4d18e9 (diff) | |
download | runes-ac3bd2e71c0cba44148cf41161b36436e4ce5a26.tar.gz runes-ac3bd2e71c0cba44148cf41161b36436e4ce5a26.zip |
cleanup
-rw-r--r-- | pty-unix.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -11,9 +11,8 @@ static void runes_pty_backend_got_data(uv_work_t *req, int status); void runes_pty_backend_spawn_subprocess(RunesTerm *t) { - RunesPtyBackend *pty; + RunesPtyBackend *pty = &t->pty; - pty = &t->pty; pty->master = posix_openpt(O_RDWR); grantpt(pty->master); unlockpt(pty->master); @@ -83,17 +82,15 @@ void runes_pty_backend_write(RunesTerm *t, char *buf, size_t len) void runes_pty_backend_request_close(RunesTerm *t) { - RunesPtyBackend *pty; + RunesPtyBackend *pty = &t->pty; - pty = &t->pty; kill(pty->child_pid, SIGHUP); } void runes_pty_backend_cleanup(RunesTerm *t) { - RunesPtyBackend *pty; + RunesPtyBackend *pty = &t->pty; - pty = &t->pty; close(pty->master); } @@ -109,12 +106,10 @@ static void runes_pty_backend_read(uv_work_t *req) static void runes_pty_backend_got_data(uv_work_t *req, int status) { - RunesTerm *t; - RunesPtyLoopData *data; + RunesPtyLoopData *data = req->data; + RunesTerm *t = data->data.t; UNUSED(status); - data = (RunesPtyLoopData *)req->data; - t = data->data.t; if (data->len > 0) { runes_parser_process_string(t, data->buf, data->len); |