diff options
Diffstat (limited to 'cups')
-rw-r--r-- | cups/hcrp.c | 6 | ||||
-rw-r--r-- | cups/spp.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cups/hcrp.c b/cups/hcrp.c index c613b4fc..c70945be 100644 --- a/cups/hcrp.c +++ b/cups/hcrp.c @@ -89,7 +89,7 @@ static int hcrp_credit_grant(int sk, uint16_t tid, uint32_t credit) cp.credit = credit; memcpy(buf, &hdr, HCRP_PDU_HDR_SIZE); memcpy(buf + HCRP_PDU_HDR_SIZE, &cp, HCRP_CREDIT_GRANT_CP_SIZE); - write(sk, buf, HCRP_PDU_HDR_SIZE + HCRP_CREDIT_GRANT_CP_SIZE); + len = write(sk, buf, HCRP_PDU_HDR_SIZE + HCRP_CREDIT_GRANT_CP_SIZE); len = read(sk, buf, sizeof(buf)); memcpy(&hdr, buf, HCRP_PDU_HDR_SIZE); @@ -114,7 +114,7 @@ static int hcrp_credit_request(int sk, uint16_t tid, uint32_t *credit) hdr.tid = htons(tid); hdr.plen = htons(0); memcpy(buf, &hdr, HCRP_PDU_HDR_SIZE); - write(sk, buf, HCRP_PDU_HDR_SIZE); + len = write(sk, buf, HCRP_PDU_HDR_SIZE); len = read(sk, buf, sizeof(buf)); memcpy(&hdr, buf, HCRP_PDU_HDR_SIZE); @@ -142,7 +142,7 @@ static int hcrp_get_lpt_status(int sk, uint16_t tid, uint8_t *lpt_status) hdr.tid = htons(tid); hdr.plen = htons(0); memcpy(buf, &hdr, HCRP_PDU_HDR_SIZE); - write(sk, buf, HCRP_PDU_HDR_SIZE); + len = write(sk, buf, HCRP_PDU_HDR_SIZE); len = read(sk, buf, sizeof(buf)); memcpy(&hdr, buf, HCRP_PDU_HDR_SIZE); @@ -38,7 +38,7 @@ int spp_print(bdaddr_t *src, bdaddr_t *dst, uint8_t channel, int fd, int copies) { struct sockaddr_rc addr; unsigned char buf[2048]; - int i, sk, len; + int i, sk, err, len; if ((sk = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) { perror("ERROR: Can't create socket"); @@ -87,7 +87,7 @@ int spp_print(bdaddr_t *src, bdaddr_t *dst, uint8_t channel, int fd, int copies) } while ((len = read(fd, buf, sizeof(buf))) > 0) { - write(sk, buf, len); + err = write(sk, buf, len); } } |