summaryrefslogtreecommitdiff
path: root/cups/hcrp.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-03-06 10:46:26 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-03-06 10:46:26 +0000
commit69f9e21b46e2827a24cad0436d52a47fdd4ee36a (patch)
tree39db65e86a3f962e7e61e10131401470c1bc32f2 /cups/hcrp.c
parent2d83bafd49738d02c86891935dff841b871b09c4 (diff)
downloadbluez-69f9e21b46e2827a24cad0436d52a47fdd4ee36a.tar.gz
Fix CUPS error and state reporting
Diffstat (limited to 'cups/hcrp.c')
-rw-r--r--cups/hcrp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cups/hcrp.c b/cups/hcrp.c
index 51497e289..468e89fbd 100644
--- a/cups/hcrp.c
+++ b/cups/hcrp.c
@@ -233,6 +233,8 @@ int hcrp_print(bdaddr_t *src, bdaddr_t *dst, unsigned short ctrl_psm, unsigned s
return 1;
}
+ fputs("STATE: -connecting-to-device\n", stderr);
+
memset(&opts, 0, sizeof(opts));
size = sizeof(opts);
@@ -300,6 +302,13 @@ int hcrp_print(bdaddr_t *src, bdaddr_t *dst, unsigned short ctrl_psm, unsigned s
break;
len = write(data_sk, buf, count);
+ if (len < 0) {
+ perror("ERROR: Error writing to device");
+ close(data_sk);
+ close(ctrl_sk);
+ return 1;
+ }
+
if (len != count)
fprintf(stderr, "ERROR: Can't send complete data\n");