From 8add6a9bc3792dcc9f276cbb763c8428d909c6ac Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Thu, 17 Jun 2010 22:16:18 +0100 Subject: [PATCH] camldm/camldm_stubs.c: Camldm.status can deal with empty tables, now. (+comment) Signed-off-by: Matthias Goergens --- camldm/camldm_stubs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/camldm/camldm_stubs.c b/camldm/camldm_stubs.c index e90a0a9..8d99217 100644 --- a/camldm/camldm_stubs.c +++ b/camldm/camldm_stubs.c @@ -166,8 +166,13 @@ value camldm_table(value dev) tmp=Val_int(0); - do { + do { next = dm_get_next_target(dmt, next, &start, &length, &target_type, ¶ms); + + /* This is how dmsetup.c checks for an empty table: */ + if (!target_type) + continue; + dm_task_get_info(dmt, &info); tuple=caml_alloc_tuple(4); @@ -181,8 +186,6 @@ value camldm_table(value dev) Store_field(r, 1, tmp); tmp=r; - - printf("params=%s\n",params); } while(next); Store_field(result,9,tmp); -- 2.39.5