diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2016-10-21 15:38:20 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2016-10-21 15:38:20 +0200 |
commit | 637a3c33da362a45a06a8b8091cea2a2211a1c82 (patch) | |
tree | 2a464050edf1d2062b6cbcd8caa35fd7d97f680d | |
parent | b3ab9c28bd520c2ba3eff3a9964387232bee0762 (diff) | |
download | libgphoto2-637a3c33da362a45a06a8b8091cea2a2211a1c82.tar.gz |
use the approach used by the msys2 porter
-rw-r--r-- | camlibs/sonydscf1/command.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/camlibs/sonydscf1/command.c b/camlibs/sonydscf1/command.c index b70b9ca0d..162cb8c7a 100644 --- a/camlibs/sonydscf1/command.c +++ b/camlibs/sonydscf1/command.c @@ -139,12 +139,14 @@ char F1newstatus(GPPort *port, int verbose, char *return_buf) unsigned char buf[34]; char status_buf[1000]=""; char tmp_buf[150]=""; + int i; + buf[0] = 0x03; buf[1] = 0x02; sendcommand(port,buf, 2); - recvdata(port, buf, 33); + i = recvdata(port, buf, 33); #ifdef DEBUG - fprintf(stderr,"Status: %02x%02x:%02x\n", buf[0], buf[1], buf[2]); + fprintf(stderr,"Status: %02x%02x:%02x(len = %d)\n", buf[0], buf[1], buf[2], i); #endif if((buf[0] != 0x03) || (buf[1] != 0x02) ||(buf[2] != 0)){ Abort(port); @@ -191,15 +193,15 @@ char F1newstatus(GPPort *port, int verbose, char *return_buf) int F1status(GPPort *port) { - unsigned char buf[34]; + int i; buf[0] = 0x03; buf[1] = 0x02; sendcommand(port,buf, 2); - recvdata(port, buf, 33); + i = recvdata(port, buf, 33); #ifdef DEBUG - fprintf(stderr,"Status: %02x%02x:%02x\n", buf[0], buf[1], buf[2]); + fprintf(stderr,"Status: %02x%02x:%02x(len = %d)\n", buf[0], buf[1], buf[2], i); #endif if((buf[0] != 0x03) || (buf[1] != 0x02) ||(buf[2] != 0)){ Abort(port); @@ -267,15 +269,16 @@ int F1fopen(GPPort *port, char *name) int F1fclose(GPPort*port) { unsigned char buf[4]; + int i; buf[0] = 0x02; buf[1] = 0x0B; buf[2] = 0x00; buf[3] = 0x00; sendcommand(port,buf, 4); - recvdata(port, buf, 3); + i = recvdata(port, buf, 3); #ifdef DEBUG - fprintf(stderr,"Fclose: %02x%02x:%02x\n", buf[0], buf[1], buf[2]); + fprintf(stderr,"Fclose: %02x%02x:%02x(len = %d)\n", buf[0], buf[1], buf[2], i); #endif if((buf[0] != 0x02) || (buf[1] != 0x0B) || (buf[2] != 0x00)){ fprintf(stderr,"F1fclose fail\n"); |