Skip to content

Commit

Permalink
catreq.cc: add scoped initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz authored and franku committed Nov 5, 2019
1 parent 2f078e6 commit 707052e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions core/src/dird/catreq.cc
Expand Up @@ -45,8 +45,6 @@

namespace directordaemon {

static const PoolDbRecord emptyPoolDbRecord = {};

/*
* Handle catalog request
* For now, we simply return next Volume to be used
Expand Down Expand Up @@ -116,7 +114,6 @@ void CatalogRequest(JobControlRecord* jcr, BareosSocket* bs)
PoolMem unwanted_volumes(PM_MESSAGE);
int index, ok, label, writing;
POOLMEM* omsg;
PoolDbRecord pr;
uint32_t Stripe, Copy;
uint64_t MediaId;
utime_t VolFirstWritten;
Expand All @@ -142,7 +139,7 @@ void CatalogRequest(JobControlRecord* jcr, BareosSocket* bs)
unwanted_volumes.check_size(bs->message_length);
if (sscanf(bs->msg, Find_media, &Job, &index, &pool_name, &mr.MediaType,
unwanted_volumes.c_str()) == 5) {
pr = emptyPoolDbRecord;
PoolDbRecord pr;
bstrncpy(pr.Name, pool_name, sizeof(pr.Name));
UnbashSpaces(pr.Name);
ok = jcr->db->GetPoolRecord(jcr, &pr);
Expand Down
2 changes: 1 addition & 1 deletion core/src/dird/consolidate.cc
Expand Up @@ -255,7 +255,7 @@ bool DoConsolidate(JobControlRecord* jcr)
/**
* Get db record of oldest jobid and check its age
*/
static const JobDbRecord emptyJobDbRecord{};
JobDbRecord emptyJobDbRecord{};
jcr->previous_jr = emptyJobDbRecord;
jcr->previous_jr.JobId = str_to_int64(jobids);
Dmsg1(10, "Previous JobId=%s\n", jobids);
Expand Down

0 comments on commit 707052e

Please sign in to comment.