Allow {start,stop}_driver to fail, abort constructor, have driver-ti try to write the entire start/stop string or error out on -1

This commit is contained in:
Paul LeoNerd Evans
2012-01-20 17:00:09 +00:00
parent 8d2fa34a52
commit 052738b8f4
3 changed files with 39 additions and 11 deletions

View File

@@ -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);