]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
compile fixes
authoridgay <idgay>
Mon, 23 Jun 2008 20:02:19 +0000 (20:02 +0000)
committeridgay <idgay>
Mon, 23 Jun 2008 20:02:19 +0000 (20:02 +0000)
apps/tests/storage/Log/RandRWC.nc

index 7e5ae49ae099b3f4106a9c26c54e8d8be8c9fd13..0420ac2ea4785d29d41c6d786a0baea897c9080c 100644 (file)
@@ -65,11 +65,15 @@ implementation {
   message_t reportmsg;
 
   void report(error_t e) {
-    uint8_t *msg = call AMSend.getPayload(&reportmsg);
+    uint8_t *msg = call AMSend.getPayload(&reportmsg, 1);
 
-    msg[0] = e;
-    if (call AMSend.send(AM_BROADCAST_ADDR, &reportmsg, 1) != SUCCESS)
-      call Leds.led0On();
+    if (msg)
+      {
+       msg[0] = e;
+       if (call AMSend.send(AM_BROADCAST_ADDR, &reportmsg, 1) == SUCCESS)
+         return;
+      }
+    call Leds.led0On();
   }
 
   event void AMSend.sendDone(message_t* msg, error_t error) {