From: Kern Sibbald Date: Fri, 13 Aug 2004 14:59:45 +0000 (+0000) Subject: Apply Meno's bnet.c patch and enable SMARTALLOC in IPADDR X-Git-Tag: Release-1.35.1~17 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f66d415635acf9d6cbce224b9d137b712423e668;p=bacula%2Fbacula Apply Meno's bnet.c patch and enable SMARTALLOC in IPADDR git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1520 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/lib/address_conf.h b/bacula/src/lib/address_conf.h index 67f731ffbf..27df19ed9d 100644 --- a/bacula/src/lib/address_conf.h +++ b/bacula/src/lib/address_conf.h @@ -26,8 +26,8 @@ */ -//class IPADDR : public SMARTALLOC { -class IPADDR { +class IPADDR : public SMARTALLOC { +// class IPADDR { public: typedef enum { R_SINGLE, R_SINGLE_PORT, R_SINGLE_ADDR, R_MULTIPLE, R_DEFAULT, R_EMPTY diff --git a/bacula/src/lib/bnet.c b/bacula/src/lib/bnet.c index 9994facfac..9d52383d72 100644 --- a/bacula/src/lib/bnet.c +++ b/bacula/src/lib/bnet.c @@ -705,12 +705,14 @@ static BSOCK *bnet_open(JCR * jcr, const char *name, char *host, char *service, break; } - free_addresses(addr_list); if (!connected) { + free_addresses(addr_list); errno = save_errno; return NULL; } - return init_bsock(jcr, sockfd, name, host, port, ipaddr->get_sockaddr()); + BSOCK* ret = init_bsock(jcr, sockfd, name, host, port, ipaddr->get_sockaddr()); + free_addresses(addr_list); + return ret; } /* diff --git a/bacula/src/lib/smartall.h b/bacula/src/lib/smartall.h index 381bfcef2f..82685a3e76 100644 --- a/bacula/src/lib/smartall.h +++ b/bacula/src/lib/smartall.h @@ -89,8 +89,8 @@ extern void *b_malloc(); #endif -//#ifdef SMARTALLOC -#ifdef xxx +#ifdef SMARTALLOC +// #ifdef xxx #define New(type) new(__FILE__, __LINE__) type @@ -118,8 +118,8 @@ void operator delete[](void *ptr, size_t i) } private: -//void *operator new(size_t s) throw() { return 0; } -//void *operator new[](size_t s) throw() { return 0; } +void *operator new(size_t s) throw() { return 0; } +void *operator new[](size_t s) throw() { return 0; } }; diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 8e5725adeb..e4d1429191 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -738,8 +738,8 @@ reread: } } while (stat == -1 && (errno == EINTR || errno == EIO) && retry++ < 11); if (stat < 0) { - Dmsg1(90, "Read device got: ERR=%s\n", strerror(errno)); clrerror_dev(dev, -1); + Dmsg1(90, "Read device got: ERR=%s\n", strerror(errno)); block->read_len = 0; Mmsg4(&dev->errmsg, _("Read error at file:blk %u:%u on device %s. ERR=%s.\n"), dev->file, dev->block_num, dev->dev_name, strerror(dev->dev_errno));