aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-20 17:00:09 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-20 17:00:09 +0000
commit052738b8f422060a09a7f5eaadc6b1c19fbcc61d (patch)
tree7ef068da40ac40593cbfb4c949378324b8cd4e5f /termkey.c
parent8d2fa34a524f0456e863a22568d6609dcb9ce82a (diff)
downloadtermo-052738b8f422060a09a7f5eaadc6b1c19fbcc61d.tar.gz
termo-052738b8f422060a09a7f5eaadc6b1c19fbcc61d.tar.xz
termo-052738b8f422060a09a7f5eaadc6b1c19fbcc61d.zip
Allow {start,stop}_driver to fail, abort constructor, have driver-ti try to write the entire start/stop string or error out on -1
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/termkey.c b/termkey.c
index a66d951..d322a93 100644
--- a/termkey.c
+++ b/termkey.c
@@ -318,7 +318,8 @@ static TermKey *termkey_new_full(int fd, int flags, size_t buffsize, int waittim
struct TermKeyDriverNode *p;
for(p = tk->drivers; p; p = p->next)
if(p->driver->start_driver)
- (*p->driver->start_driver)(tk, p->info);
+ if(!(*p->driver->start_driver)(tk, p->info))
+ goto abort_free_drivers;
#ifdef DEBUG
fprintf(stderr, "Drivers started; termkey instance %p is ready\n", tk);