Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Dec 1, 2022
1 parent 3f97f01 commit 84c66e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions core/src/filed/fd_plugins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,6 @@ int PluginEstimate(JobControlRecord* jcr, FindFilesPacket* ff_pkt, bool)
{
int len;
char* cmd = ff_pkt->top_fname;
save_pkt sp;
bEvent event;
bEventType eventType;
PoolMem fname(PM_FNAME);
Expand Down Expand Up @@ -931,6 +930,7 @@ int PluginEstimate(JobControlRecord* jcr, FindFilesPacket* ff_pkt, bool)

// Loop getting filenames to backup then saving them
while (!jcr->IsJobCanceled()) {
save_pkt sp;
sp.portable = true;
CopyBits(FO_MAX, ff_pkt->flags, sp.flags);
sp.cmd = cmd;
Expand Down Expand Up @@ -1427,9 +1427,9 @@ BxattrExitCode PluginBuildXattrStreams(
int xattr_count = 0;
xattr_t* current_xattr;
uint32_t expected_serialize_len = 0;
xattr_pkt xp;

while (1) {
xattr_pkt xp;
xp.fname = xattr_data->last_fname;

switch (PlugFunc(plugin)->getXattr(jcr->plugin_ctx, &xp)) {
Expand Down
11 changes: 4 additions & 7 deletions core/src/filed/fd_plugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,11 @@ struct BareosFilePacket;
struct FindFilesPacket;
#endif /* FILE_DAEMON */

namespace IoStatus {
enum IoStatus : int
{
error = -1,
success = 0,
do_io_in_core = 1,
struct IoStatus {
static constexpr int error = -1;
static constexpr int success = 0;
static constexpr int do_io_in_core = 1;
};
}

template <typename T> class alist;

Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/filed/python/test/python-fd-module-tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bRC bareosJobMsg(PluginContext*,
char buffer[1024]{};
va_list arg_ptr;
va_start(arg_ptr, fmt);
vsprintf(buffer, fmt, arg_ptr);
vsnprintf(buffer, 1024, fmt, arg_ptr);
va_end(arg_ptr);
printf("bareosJobMsg file:%s line:%d type:%d time: %+" PRId64 ", %s\n",
file, line, type, (int64_t)mtime, buffer);
Expand All @@ -118,7 +118,7 @@ static bRC bareosDebugMsg(PluginContext*,
char buffer[1024]{};
va_list arg_ptr;
va_start(arg_ptr, fmt);
vsprintf(buffer, fmt, arg_ptr);
vsnprintf(buffer, 1024, fmt, arg_ptr);
va_end(arg_ptr);
printf("bareosDebugMsg: %s %d %d %s\n", fname, line, level, buffer);
return bRC_OK;
Expand Down

0 comments on commit 84c66e1

Please sign in to comment.