Reacted on warning of cppcheck about libburn/sg-freebsd.c

This commit is contained in:
Thomas Schmitt 2011-07-12 14:20:52 +00:00
parent 54325147ee
commit a2d2ec150b
2 changed files with 8 additions and 7 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2011.07.12.141932" #define Cdrskin_timestamP "2011.07.12.142018"

View File

@ -985,12 +985,13 @@ ex:;
int burn_os_is_2k_seekrw(char *path, int flag) int burn_os_is_2k_seekrw(char *path, int flag)
{ {
struct stat stbuf; struct stat stbuf;
#ifdef Libburn_DIOCGMEDIASIZE_ISBLK
int fd, ret;
off_t add_size;
#else
char *spt; char *spt;
int i, e; int i, e;
#ifdef Libburn_DIOCGMEDIASIZE_ISBLK #endif /* ! Libburn_DIOCGMEDIASIZE_ISBLK */
int fd;
off_t add_size;
#endif
if (stat(path, &stbuf) == -1) if (stat(path, &stbuf) == -1)
return 0; return 0;
@ -1057,13 +1058,11 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
struct stat stbuf; struct stat stbuf;
struct statvfs vfsbuf; struct statvfs vfsbuf;
char *testpath = NULL, *cpt; char *testpath = NULL, *cpt;
long blocks;
off_t add_size = 0; off_t add_size = 0;
int fd, ret; int fd, ret;
BURN_ALLOC_MEM(testpath, char, 4096); BURN_ALLOC_MEM(testpath, char, 4096);
testpath[0] = 0; testpath[0] = 0;
blocks = *bytes / 512;
if (stat(path, &stbuf) == -1) { if (stat(path, &stbuf) == -1) {
strcpy(testpath, path); strcpy(testpath, path);
cpt = strrchr(testpath, '/'); cpt = strrchr(testpath, '/');
@ -1080,7 +1079,9 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
} else if(S_ISBLK(stbuf.st_mode)) { } else if(S_ISBLK(stbuf.st_mode)) {
int open_mode = O_RDWR, fd, ret; int open_mode = O_RDWR, fd, ret;
long blocks;
blocks = *bytes / 512;
if(burn_sg_open_o_excl) if(burn_sg_open_o_excl)
open_mode |= O_EXCL; open_mode |= O_EXCL;
fd = open(path, open_mode); fd = open(path, open_mode);