Skip to content

Commit

Permalink
tools: punchboot: bufix: wait_for_device
Browse files Browse the repository at this point in the history
Actually try to find a device within the specified timeout. Before this
commit the code would return early if no device was enumerated which is
not the expected behaviour.
  • Loading branch information
Jonas Blixt committed Jun 5, 2024
1 parent 3624c16 commit 8013f1f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tools/punchboot/python_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,13 +1067,12 @@ static PyObject *wait_for_device(PyObject *self, PyObject *args, PyObject *kwds)

while (true) {
rc = init_transport(NULL, NULL, &ctx);
if (rc != PB_RESULT_OK) {
PyErr_SetString(PyExc_TimeoutError, "No device found");
return NULL;

if (rc == 0) {
rc = get_uuid(ctx, uuid);
pb_api_free_context(ctx);
}

rc = get_uuid(ctx, uuid);
pb_api_free_context(ctx);
if (rc != PB_RESULT_OK) {
if (timeout > 0) {
sleep(1);
Expand Down

0 comments on commit 8013f1f

Please sign in to comment.