summaryrefslogtreecommitdiffstats
path: root/cups/hcrp.c
diff options
context:
space:
mode:
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 51497e28..468e89fb 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");