Commit 38f0b147a57c1d64d068d3a15efde83322a5c90e

Authored by bellard
1 parent bec9d989

fixed ADB error reporting


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1010 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 4 additions and 3 deletions
hw/cuda.c
@@ -545,13 +545,14 @@ static void cuda_receive_packet_from_host(CUDAState *s, @@ -545,13 +545,14 @@ static void cuda_receive_packet_from_host(CUDAState *s,
545 uint8_t obuf[ADB_MAX_OUT_LEN + 2]; 545 uint8_t obuf[ADB_MAX_OUT_LEN + 2];
546 int olen; 546 int olen;
547 olen = adb_request(&adb_bus, obuf + 2, data + 1, len - 1); 547 olen = adb_request(&adb_bus, obuf + 2, data + 1, len - 1);
548 - if (olen != 0) { 548 + if (olen > 0) {
549 obuf[0] = ADB_PACKET; 549 obuf[0] = ADB_PACKET;
550 obuf[1] = 0x00; 550 obuf[1] = 0x00;
551 } else { 551 } else {
552 - /* empty reply */ 552 + /* error */
553 obuf[0] = ADB_PACKET; 553 obuf[0] = ADB_PACKET;
554 - obuf[1] = 0x02; 554 + obuf[1] = -olen;
  555 + olen = 0;
555 } 556 }
556 cuda_send_packet_to_host(s, obuf, olen + 2); 557 cuda_send_packet_to_host(s, obuf, olen + 2);
557 } 558 }