1 --- toolchain/ldrviewer/ldr.c~ 2006-10-17 15:14:17.000000000 -0400
2 +++ toolchain/ldrviewer/ldr.c 2006-10-17 15:27:20.000000000 -0400
4 printf("Trying to read autobaud ... ");
5 ret = read(fd, autobaud, 4);
8 printf(" read failed we got %d bytes\n", ret);
9 printf(" Data %02x %02x %02x %02x \n",
14 - //if (autobaud[0]==0xBF)
16 - goto canned_failure;
18 + if ((autobaud[0]==0xBF) && (ret > 1)) {
19 + ret += read(fd, &autobaud[ret], 4-ret);
21 + printf(" after 2nd read ret = %d\n", ret);
23 + printf(" Data %02x %02x %02x %02x \n",
30 + if ( ret != 4 ) goto canned_failure;