From: Kern Sibbald Date: Wed, 15 Mar 2017 10:38:45 +0000 (+0100) Subject: Fix Solaris 10 problems reported by Phil Stracchino X-Git-Tag: Release-7.4.7~7 X-Git-Url: https://git.sur5r.net/?p=bacula%2Fbacula;a=commitdiff_plain;h=40e3df70b28a37f8239bce5ddbbf79f64fc7ca82 Fix Solaris 10 problems reported by Phil Stracchino --- diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index 2b89e96b02..bf33b78c82 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -1,7 +1,7 @@ /* Bacula(R) - The Network Backup Solution - Copyright (C) 2000-2015 Kern Sibbald + Copyright (C) 2000-2017 Kern Sibbald Copyright (C) 2000-2014 Free Software Foundation Europe e.V. The original author of Bacula is Kern Sibbald, with contributions @@ -60,17 +60,17 @@ #ifdef DEBUG #define ASSERT(x) if (!(x)) { \ - char *jcr = NULL; \ + char *tjcr = NULL; \ Emsg1(M_ERROR, 0, _("Failed ASSERT: %s\n"), #x); \ Pmsg1(000, _("Failed ASSERT: %s\n"), #x); \ - jcr[0] = 0; } + tjcr[0] = 0; } #define ASSERT2(x,y) if (!(x)) { \ set_assert_msg(__FILE__, __LINE__, y); \ Emsg1(M_ERROR, 0, _("Failed ASSERT: %s\n"), #x); \ Pmsg1(000, _("Failed ASSERT: %s\n"), #x); \ - char *jcr = NULL; \ - jcr[0] = 0; } + char *tjcr = NULL; \ + tjcr[0] = 0; } #else #define ASSERT(x) #define ASSERT2(x, y) diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index e2d48f6ae2..2e03c40d47 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -1,7 +1,7 @@ /* Bacula(R) - The Network Backup Solution - Copyright (C) 2000-2016 Kern Sibbald + Copyright (C) 2000-2017 Kern Sibbald The original author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -65,7 +65,7 @@ typedef enum { typedef enum { SQL_DRIVER_TYPE_MYSQL = 0, SQL_DRIVER_TYPE_POSTGRESQL = 1, - SQL_DRIVER_TYPE_SQLITE3 = 2, + SQL_DRIVER_TYPE_SQLITE3 = 2 } SQL_DRIVER; diff --git a/bacula/src/findlib/fstype.c b/bacula/src/findlib/fstype.c index 4fc4f2669b..1ae6909436 100644 --- a/bacula/src/findlib/fstype.c +++ b/bacula/src/findlib/fstype.c @@ -1,7 +1,7 @@ /* Bacula(R) - The Network Backup Solution - Copyright (C) 2000-2015 Kern Sibbald + Copyright (C) 2000-2017 Kern Sibbald The original author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -291,6 +291,7 @@ bool fstype(FF_PKT *ff_pkt, char *fs, int fslen) #include #include +#include bool fstype(FF_PKT *ff_pkt, char *fs, int fslen) { diff --git a/bacula/src/stored/lock.c b/bacula/src/stored/lock.c index f5f6498f0b..f269bcec7b 100644 --- a/bacula/src/stored/lock.c +++ b/bacula/src/stored/lock.c @@ -1,7 +1,7 @@ /* Bacula(R) - The Network Backup Solution - Copyright (C) 2000-2016 Kern Sibbald + Copyright (C) 2000-2017 Kern Sibbald The original author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -154,25 +154,25 @@ void DEVICE::dunblock(bool locked) #ifdef DEV_DEBUG_LOCK -void DEVICE::dbg_Lock(const char *file, int line) +void DEVICE::dbg_Lock(const char *tfile, int line) { - Dmsg3(sd_dbglvl, "Lock from %s:%d precnt=%d\n", file, line, m_count); - bthread_mutex_lock_p(&m_mutex, file, line); + Dmsg3(sd_dbglvl, "Lock from %s:%d precnt=%d\n", tfile, line, m_count); + bthread_mutex_lock_p(&m_mutex, tfile, line); m_pid = pthread_self(); m_count++; } -void DEVICE::dbg_Unlock(const char *file, int line) +void DEVICE::dbg_Unlock(const char *tfile, int line) { m_count--; - Dmsg3(sd_dbglvl, "Unlock from %s:%d postcnt=%d\n", file, line, m_count); - bthread_mutex_unlock_p(&m_mutex, file, line); + Dmsg3(sd_dbglvl, "Unlock from %s:%d postcnt=%d\n", tfile, line, m_count); + bthread_mutex_unlock_p(&m_mutex, tfile, line); } -void DEVICE::dbg_rUnlock(const char *file, int line) +void DEVICE::dbg_rUnlock(const char *tfile, int line) { - Dmsg2(sd_dbglvl, "rUnlock from %s:%d\n", file, line); - dbg_Unlock(file, line); + Dmsg2(sd_dbglvl, "rUnlock from %s:%d\n", tfile, line); + dbg_Unlock(tfile, line); } #else @@ -208,14 +208,14 @@ void DEVICE::Unlock() * and preparing the label. */ #ifdef DEV_DEBUG_LOCK -void DEVICE::dbg_rLock(const char *file, int line, bool locked) +void DEVICE::dbg_rLock(const char *tfile, int line, bool locked) { Dmsg3(sd_dbglvl, "rLock blked=%s from %s:%d\n", print_blocked(), - file, line); + tfile, line); if (!locked) { /* lockmgr version of P(m_mutex) */ - bthread_mutex_lock_p(&m_mutex, file, line); + bthread_mutex_lock_p(&m_mutex, tfile, line); m_count++; } @@ -228,9 +228,9 @@ void DEVICE::dbg_rLock(const char *file, int line, bool locked) Dmsg3(sd_dbglvl, "rLock blked=%s no_wait=%p me=%p\n", print_blocked(), no_wait_id, pthread_self()); #endif - if ((stat = bthread_cond_wait_p(&this->wait, &m_mutex, file, line)) != 0) { + if ((stat = bthread_cond_wait_p(&this->wait, &m_mutex, tfile, line)) != 0) { berrno be; - this->dbg_Unlock(file, line); + this->dbg_Unlock(tfile, line); Emsg1(M_ABORT, 0, _("pthread_cond_wait failure. ERR=%s\n"), be.bstrerror(stat)); } @@ -272,38 +272,38 @@ void DEVICE::rLock(bool locked) #ifdef SD_DEBUG_LOCK -void DEVICE::dbg_Lock_acquire(const char *file, int line) +void DEVICE::dbg_Lock_acquire(const char *tfile, int line) { - Dmsg2(sd_dbglvl, "Lock_acquire from %s:%d\n", file, line); - bthread_mutex_lock_p(&acquire_mutex, file, line); + Dmsg2(sd_dbglvl, "Lock_acquire from %s:%d\n", tfile, line); + bthread_mutex_lock_p(&acquire_mutex, tfile, line); } -void DEVICE::dbg_Unlock_acquire(const char *file, int line) +void DEVICE::dbg_Unlock_acquire(const char *tfile, int line) { - Dmsg2(sd_dbglvl, "Unlock_acquire from %s:%d\n", file, line); - bthread_mutex_unlock_p(&acquire_mutex, file, line); + Dmsg2(sd_dbglvl, "Unlock_acquire from %s:%d\n", tfile, line); + bthread_mutex_unlock_p(&acquire_mutex, tfile, line); } -void DEVICE::dbg_Lock_read_acquire(const char *file, int line) +void DEVICE::dbg_Lock_read_acquire(const char *tfile, int line) { - Dmsg2(sd_dbglvl, "Lock_read_acquire from %s:%d\n", file, line); - bthread_mutex_lock_p(&read_acquire_mutex, file, line); + Dmsg2(sd_dbglvl, "Lock_read_acquire from %s:%d\n", tfile, line); + bthread_mutex_lock_p(&read_acquire_mutex, tfile, line); } -void DEVICE::dbg_Unlock_read_acquire(const char *file, int line) +void DEVICE::dbg_Unlock_read_acquire(const char *tfile, int line) { - Dmsg2(sd_dbglvl, "Unlock_read_acquire from %s:%d\n", file, line); - bthread_mutex_unlock_p(&read_acquire_mutex, file, line); + Dmsg2(sd_dbglvl, "Unlock_read_acquire from %s:%d\n", tfile, line); + bthread_mutex_unlock_p(&read_acquire_mutex, tfile, line); } -void DEVICE::dbg_Lock_VolCatInfo(const char *file, int line) +void DEVICE::dbg_Lock_VolCatInfo(const char *tfile, int line) { - bthread_mutex_lock_p(&volcat_mutex, file, line); + bthread_mutex_lock_p(&volcat_mutex, tfile, line); } -void DEVICE::dbg_Unlock_VolCatInfo(const char *file, int line) +void DEVICE::dbg_Unlock_VolCatInfo(const char *tfile, int line) { - bthread_mutex_unlock_p(&volcat_mutex, file, line); + bthread_mutex_unlock_p(&volcat_mutex, tfile, line); } #else