Making optional use of statvfs() in sg-dummy

This commit is contained in:
Thomas Schmitt 2009-03-03 09:20:53 +00:00
parent 90e6740611
commit 11e69fa320
3 changed files with 15 additions and 3 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.03.02.200132"
#define Cdrskin_timestamP "2009.03.03.092057"

View File

@ -162,6 +162,16 @@ TARGET_SHIZZLE
AC_SUBST(ARCH)
AC_SUBST(LIBBURN_ARCH_LIBS)
dnl ts A90303
dnl Check the preconditions for using statvfs() in sg-dummy
dnl (sg-linux and sg-freebsd use statvfs() unconditionally)
STATVFS_DEF=-DLibburn_os_has_statvfS
AC_CHECK_HEADER(sys/statvfs.h, X=, STATVFS_DEF=)
AC_CHECK_FUNC([statvfs], X=, STATVFS_DEF=)
dnl If this would be done more specifically in Makefile.am
dnl via libburn_libburn_la_CFLAGS then undesired .o file names would emerge
CFLAGS="$CFLAGS $STATVFS_DEF"
dnl Add compiler-specific flags
dnl See if the user wants aggressive optimizations of the code

View File

@ -20,6 +20,10 @@ Present implementation: default dummy which enables libburn only to work
#include <sys/stat.h>
#include <string.h>
#ifdef Libburn_os_has_statvfS
#include <sys/statvfs.h>
#endif /* Libburn_os_has_stavtfS */
#include "transport.h"
#include "drive.h"
#include "sg.h"
@ -34,7 +38,6 @@ Present implementation: default dummy which enables libburn only to work
extern struct libdax_msgs *libdax_messenger;
/** Returns the next index number and the next enumerated drive address.
The enumeration has to cover all available and accessible drives. It is
allowed to return addresses of drives which are not available but under
@ -165,7 +168,6 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
#ifdef Libburn_os_has_statvfS
struct statvfs vfsbuf;
int open_mode = O_RDONLY, fd, ret;
#endif
char testpath[4096], *cpt;