aboutsummaryrefslogtreecommitdiff
path: root/src/target.c
diff options
context:
space:
mode:
authorGareth McMullin2012-11-03 16:42:46 +1300
committerGareth McMullin2012-11-03 16:42:46 +1300
commit0990c2224c201a1f42533a754c9ef3b548335406 (patch)
tree3f0da0778087db8cd0c8471525b05461d7afef3d /src/target.c
parentfaa43fdc92f6d0749c51522b777d678c2a4fe8f4 (diff)
Allow target attachment to timeout and report failure.
This is needed for if the target device is held in reset.
Diffstat (limited to 'src/target.c')
-rw-r--r--src/target.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/target.c b/src/target.c
index a28c55f..b46f9e3 100644
--- a/src/target.c
+++ b/src/target.c
@@ -75,7 +75,8 @@ target *target_attach(target *t, target_destroy_callback destroy_cb)
t->destroy_callback = destroy_cb;
- t->attach(t);
+ if (!t->attach(t))
+ return NULL;
return t;
}