From 347ff2ed7f282d9022323b7a9bb37206354bc515 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Tue, 9 Oct 2007 04:12:13 +0000 Subject: [PATCH] Raise a runtime error if the transmit fails git-svn-id: file:///home/svn/framework3/trunk@5141 4d416f70-5f16-0410-b530-b9f4589650da --- external/ruby-lorcon/Lorcon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/external/ruby-lorcon/Lorcon.c b/external/ruby-lorcon/Lorcon.c index 1f3f5122d4..182b5a1c5b 100644 --- a/external/ruby-lorcon/Lorcon.c +++ b/external/ruby-lorcon/Lorcon.c @@ -489,8 +489,10 @@ static VALUE lorcon_device_write(int argc, VALUE *argv, VALUE self) { for (; cnt > 0; cnt--) { ret = tx80211_txpacket(&rld->in_tx, &rld->in_packet); - if (ret < 0) + if (ret < 0) { + rb_raise(rb_eRuntimeError, "Lorcon could not transmit packet: %s", tx80211_geterrstr(&rld->in_tx)); return(INT2NUM(ret)); + } if (dly > 0) #ifdef _MSC_VER Sleep(dly);