From 34c86e88d994fb5ddd5bde505dfc5c30e57c53c7 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 12 Jul 2011 14:22:19 +0000 Subject: [PATCH] Reacted on warning of cppcheck about libburn/sg-libcdio.c --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/sg-libcdio.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index dc9dabd..1e999cb 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.07.12.142018" +#define Cdrskin_timestamP "2011.07.12.142141" diff --git a/libburn/sg-libcdio.c b/libburn/sg-libcdio.c index 9b02754..1cac795 100644 --- a/libburn/sg-libcdio.c +++ b/libburn/sg-libcdio.c @@ -614,7 +614,7 @@ int sg_release(struct burn_drive *d) */ int sg_issue_command(struct burn_drive *d, struct command *c) { - int sense_valid = 0, i, timeout_ms, no_retry = 0; + int sense_valid = 0, i, timeout_ms; int key = 0, asc = 0, ascq = 0, done = 0; time_t start_time; driver_return_code_t i_status; @@ -701,7 +701,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c) c->sense[0] = 0x70; /*Fixed format sense data*/ c->sense[2] = 0x02; c->sense[12] = 0x04; - no_retry = 1; + done = 1; } } if (i_status != 0 || (key || asc || ascq)) { @@ -860,13 +860,11 @@ int burn_os_stdio_capacity(char *path, off_t *bytes) #endif char *testpath = NULL, *cpt; - long blocks; off_t add_size = 0; int ret; BURN_ALLOC_MEM(testpath, char, 4096); testpath[0] = 0; - blocks = *bytes / 512; if (stat(path, &stbuf) == -1) { strcpy(testpath, path); cpt = strrchr(testpath, '/'); @@ -884,7 +882,9 @@ int burn_os_stdio_capacity(char *path, off_t *bytes) /* GNU/Linux specific determination of block device size */ } else if(S_ISBLK(stbuf.st_mode)) { int open_mode = O_RDONLY, fd, ret; + long blocks; + blocks = *bytes / 512; fd = open(path, open_mode); if (fd == -1) {ret = -2; goto ex;}