From a2d2ec150b7abf161d6a0bd3bb8ed98080983c4f Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 12 Jul 2011 14:20:52 +0000 Subject: [PATCH] Reacted on warning of cppcheck about libburn/sg-freebsd.c --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/sg-freebsd.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index b978fe1..dc9dabd 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.07.12.141932" +#define Cdrskin_timestamP "2011.07.12.142018" diff --git a/libburn/sg-freebsd.c b/libburn/sg-freebsd.c index 033526f..7434fb9 100644 --- a/libburn/sg-freebsd.c +++ b/libburn/sg-freebsd.c @@ -985,12 +985,13 @@ ex:; int burn_os_is_2k_seekrw(char *path, int flag) { struct stat stbuf; +#ifdef Libburn_DIOCGMEDIASIZE_ISBLK + int fd, ret; + off_t add_size; +#else char *spt; int i, e; -#ifdef Libburn_DIOCGMEDIASIZE_ISBLK - int fd; - off_t add_size; -#endif +#endif /* ! Libburn_DIOCGMEDIASIZE_ISBLK */ if (stat(path, &stbuf) == -1) return 0; @@ -1057,13 +1058,11 @@ int burn_os_stdio_capacity(char *path, off_t *bytes) struct stat stbuf; struct statvfs vfsbuf; char *testpath = NULL, *cpt; - long blocks; off_t add_size = 0; int fd, ret; BURN_ALLOC_MEM(testpath, char, 4096); testpath[0] = 0; - blocks = *bytes / 512; if (stat(path, &stbuf) == -1) { strcpy(testpath, path); cpt = strrchr(testpath, '/'); @@ -1080,7 +1079,9 @@ int burn_os_stdio_capacity(char *path, off_t *bytes) } else if(S_ISBLK(stbuf.st_mode)) { int open_mode = O_RDWR, fd, ret; + long blocks; + blocks = *bytes / 512; if(burn_sg_open_o_excl) open_mode |= O_EXCL; fd = open(path, open_mode);