Skip to content

Commit

Permalink
traymon/stored/vadp_dumper: fix maybe-uninitialized warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz authored and franku committed Nov 5, 2019
1 parent 0ac9907 commit 8360be0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions core/src/qt-tray-monitor/tray_conf.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2004-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2016 Bareos GmbH & Co. KG
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -336,7 +336,7 @@ static bool SaveResource(int type, ResourceItem* items, int pass)
}

if (!error) {
BareosResource* new_resource;
BareosResource* new_resource = nullptr;
switch (type) {
case R_MONITOR:
new_resource = res_monitor;
Expand Down
30 changes: 18 additions & 12 deletions core/src/stored/reserve.cc
Expand Up @@ -2,7 +2,7 @@
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
Copyright (C) 2016-2016 Bareos GmbH & Co. KG
Copyright (C) 2016-2019 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -406,7 +406,8 @@ static bool IsVolInAutochanger(ReserveContext& rctx, VolumeReservationItem* vol)
* Find resource, and make sure we were able to open it
*/
if (bstrcmp(rctx.device_name, changer->resource_name_)) {
Dmsg1(debuglevel, "Found changer device %s\n", vol->dev->device->resource_name_);
Dmsg1(debuglevel, "Found changer device %s\n",
vol->dev->device->resource_name_);
return true;
}
Dmsg1(debuglevel, "Incorrect changer device %s\n", changer->resource_name_);
Expand All @@ -425,7 +426,7 @@ bool FindSuitableDeviceForJob(JobControlRecord* jcr, ReserveContext& rctx)
{
bool ok = false;
DirectorStorage* store;
char* device_name;
char* device_name = nullptr;
alist* dirstore;
DeviceControlRecord* dcr = jcr->dcr;

Expand Down Expand Up @@ -572,8 +573,8 @@ int SearchResForDevice(ReserveContext& rctx)
* Look through Autochangers first
*/
foreach_res (changer, R_AUTOCHANGER) {
Dmsg2(debuglevel, "Try match changer res=%s, wanted %s\n", changer->resource_name_,
rctx.device_name);
Dmsg2(debuglevel, "Try match changer res=%s, wanted %s\n",
changer->resource_name_, rctx.device_name);
/*
* Find resource, and make sure we were able to open it
*/
Expand All @@ -582,7 +583,8 @@ int SearchResForDevice(ReserveContext& rctx)
* Try each device in this AutoChanger
*/
foreach_alist (rctx.device, changer->device) {
Dmsg1(debuglevel, "Try changer device %s\n", rctx.device->resource_name_);
Dmsg1(debuglevel, "Try changer device %s\n",
rctx.device->resource_name_);
if (!rctx.device->autoselect) {
Dmsg1(100, "Device %s not autoselect skipped.\n",
rctx.device->resource_name_);
Expand All @@ -601,7 +603,8 @@ int SearchResForDevice(ReserveContext& rctx)
rctx.device->resource_name_, rctx.jcr->dcr->dev->NumReserved());
} else {
Dmsg2(debuglevel, "Device %s reserved=%d for read.\n",
rctx.device->resource_name_, rctx.jcr->read_dcr->dev->NumReserved());
rctx.device->resource_name_,
rctx.jcr->read_dcr->dev->NumReserved());
}
return status;
}
Expand All @@ -613,8 +616,8 @@ int SearchResForDevice(ReserveContext& rctx)
*/
if (!rctx.autochanger_only) {
foreach_res (rctx.device, R_DEVICE) {
Dmsg2(debuglevel, "Try match res=%s wanted %s\n", rctx.device->resource_name_,
rctx.device_name);
Dmsg2(debuglevel, "Try match res=%s wanted %s\n",
rctx.device->resource_name_, rctx.device_name);

/*
* Find resource, and make sure we were able to open it
Expand All @@ -632,7 +635,8 @@ int SearchResForDevice(ReserveContext& rctx)
rctx.device->resource_name_, rctx.jcr->dcr->dev->NumReserved());
} else {
Dmsg2(debuglevel, "Device %s reserved=%d for read.\n",
rctx.device->resource_name_, rctx.jcr->read_dcr->dev->NumReserved());
rctx.device->resource_name_,
rctx.jcr->read_dcr->dev->NumReserved());
}
return status;
}
Expand Down Expand Up @@ -661,10 +665,12 @@ int SearchResForDevice(ReserveContext& rctx)
*/
if (rctx.store->append == SD_APPEND) {
Dmsg2(debuglevel, "Device %s reserved=%d for append.\n",
rctx.device->resource_name_, rctx.jcr->dcr->dev->NumReserved());
rctx.device->resource_name_,
rctx.jcr->dcr->dev->NumReserved());
} else {
Dmsg2(debuglevel, "Device %s reserved=%d for read.\n",
rctx.device->resource_name_, rctx.jcr->read_dcr->dev->NumReserved());
rctx.device->resource_name_,
rctx.jcr->read_dcr->dev->NumReserved());
}
return status;
}
Expand Down
2 changes: 1 addition & 1 deletion vmware/vadp_dumper/bareos_vadp_dumper.cc
Expand Up @@ -1649,7 +1649,7 @@ void usage(const char* program_name)

int main(int argc, char** argv)
{
bool retval;
bool retval = false;
const char* program_name;
int ch;

Expand Down

0 comments on commit 8360be0

Please sign in to comment.