From 0afa6bbf7fbc3acf438fb53bbce362760cc9ca8a Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 19 Jun 2008 15:17:13 +0000 Subject: [PATCH] ebl Modify vtape driver to compile only under linux git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7176 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/vtape.c | 52 ++++++++++++++++++++++++++------------- bacula/src/stored/vtape.h | 9 +++++-- bacula/src/version.h | 2 +- bacula/technotes-2.5 | 1 + 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/bacula/src/stored/vtape.c b/bacula/src/stored/vtape.c index 35b7af4a90..7af0b32bb6 100644 --- a/bacula/src/stored/vtape.c +++ b/bacula/src/stored/vtape.c @@ -62,6 +62,9 @@ Device { #include "vtape.h" + +#ifdef USE_VTAPE + static int dbglevel = 100; #define FILE_OFFSET 30 vtape *ftape_list[FTAPE_MAX_DRIVE]; @@ -164,21 +167,6 @@ int vtape_ioctl(int fd, unsigned long int request, ...) return result; } -/****************************************************************/ - -#ifdef HAVE_FREEBSD_OS -int vtape::tape_op(struct mtop *mt_com) -{ - return -1; -} - -int vtape::tape_get(struct mtget *mt_get) -{ - return -1; -} - -#else /* Posix */ - int vtape::tape_op(struct mtop *mt_com) { int result=0; @@ -404,8 +392,6 @@ int vtape::tape_get(struct mtget *mt_get) return 0; } -#endif /* ! HAVE_FREEBSD_OS */ - int vtape::tape_pos(struct mtpos *mt_pos) { if (current_block >= 0) { @@ -1009,3 +995,35 @@ void vtape::dump() atEOF, atEOT, atEOD, atBOT); } +#else /* USE_VTAPE */ + +int vtape_ioctl(int fd, unsigned long int request, ...) +{ + return -1; +} + +int vtape_open(const char *pathname, int flags, ...) +{ + return -1; +} + +int vtape_close(int fd) +{ + return -1; +} + +void vtape_debug(int level) +{ +} + +ssize_t vtape_read(int fd, void *buffer, size_t count) +{ + return -1; +} + +ssize_t vtape_write(int fd, const void *buffer, size_t count) +{ + return -1; +} + +#endif /* ! USE_VTAPE */ diff --git a/bacula/src/stored/vtape.h b/bacula/src/stored/vtape.h index 0b5a94b109..052beac407 100644 --- a/bacula/src/stored/vtape.h +++ b/bacula/src/stored/vtape.h @@ -38,8 +38,6 @@ #include #include "bacula.h" -#define FTAPE_MAX_DRIVE 50 - /* * Theses functions will replace open/read/write */ @@ -50,6 +48,10 @@ void vtape_debug(int level); ssize_t vtape_read(int fd, void *buffer, size_t count); ssize_t vtape_write(int fd, const void *buffer, size_t count); +#ifdef USE_VTAPE + +#define FTAPE_MAX_DRIVE 50 + typedef enum { VT_READ_EOF, /* Need to read the entire EOF struct */ VT_SKIP_EOF /* Have already read the EOF byte */ @@ -106,4 +108,7 @@ public: int tape_pos(struct mtpos *mt_com); }; + +#endif /*!USE_VTAPE */ + #endif /* !VTAPE_H */ diff --git a/bacula/src/version.h b/bacula/src/version.h index 43612bdb48..dfc0f21edc 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -61,7 +61,7 @@ * USE_VTAPE is a dummy tape driver. This is useful to * run regress test. */ -#ifdef DEVELOPER +#ifdef HAVE_LINUX_OS #define USE_VTAPE #endif diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index e812355fd9..fd375514b5 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -26,6 +26,7 @@ vtape driver General: 19Jun08 +ebl Update vtape driver to compile only under linux. ebl Fix a bug when restoring with a wrong mediatype. 18Jun08 kes Eliminate ints from conf files and structures to avoid -- 2.39.5