From: Radosław Korzeniewski Date: Tue, 24 Nov 2020 18:14:24 +0000 (+0100) Subject: pluginlib: Update ptcomm. X-Git-Tag: Release-11.3.2~748 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2e47685c36b73345288895e0429e8bb5bc08bd7;p=thirdparty%2Fbacula.git pluginlib: Update ptcomm. --- diff --git a/bacula/src/plugins/fd/pluginlib/pluginlib.cpp b/bacula/src/plugins/fd/pluginlib/pluginlib.cpp index 599502bb9..64ec05a5f 100644 --- a/bacula/src/plugins/fd/pluginlib/pluginlib.cpp +++ b/bacula/src/plugins/fd/pluginlib/pluginlib.cpp @@ -501,9 +501,9 @@ bool add_param_str(alist **list, const char *pname, const char *name, char *valu /** * @brief Scans for `prefix` in `cmd`, when match copy remaining to `param`. * - * - * @param cmd - * @param param + * @param cmd - command string to can for prefix and extract parameter + * @param prefix - prefix string to check + * @param param - when `prefix` match then copy the remaining from `cmd` * @return true - when prefix match in the command * @return false - when not */ diff --git a/bacula/src/plugins/fd/pluginlib/ptcomm.cpp b/bacula/src/plugins/fd/pluginlib/ptcomm.cpp index 943555eed..b2094fe79 100644 --- a/bacula/src/plugins/fd/pluginlib/ptcomm.cpp +++ b/bacula/src/plugins/fd/pluginlib/ptcomm.cpp @@ -56,11 +56,9 @@ extern int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc, */ bool PTCOMM::close_extpipe(bpContext *ctx) { - int rc; - /* close expipe if used */ if (extpipe > 0){ - rc = close(extpipe); + int rc = close(extpipe); extpipe = -1; if (rc != 0){ berrno be; diff --git a/bacula/src/plugins/fd/pluginlib/ptcomm.h b/bacula/src/plugins/fd/pluginlib/ptcomm.h index 515c68093..b9197d60b 100644 --- a/bacula/src/plugins/fd/pluginlib/ptcomm.h +++ b/bacula/src/plugins/fd/pluginlib/ptcomm.h @@ -62,10 +62,10 @@ class PTCOMM : public SMARTALLOC { private: BPIPE *bpipe; // this is our bpipe to communicate with backend */ - int rfd; // - int wfd; // - int efd; // - int maxfd; // + int rfd; // backend `stdout` to plugin file descriptor + int wfd; // backend `stdin` to plugin file descriptor + int efd; // backend `stderr` to plugin file descriptor + int maxfd; // max file descriptors from bpipe channels POOL_MEM errmsg; // message buffer for error string */ int extpipe; // set when data blast is performed using external pipe/file */ POOL_MEM extpipename; // name of the external pipe/file for restore */ @@ -75,7 +75,7 @@ private: bool f_cont; // when we are reading next part of data packet */ bool abort_on_error; // abort on error flag */ int32_t remaininglen; // the number of bytes to read when `f_cont` is true - struct timeval _timeout; // + struct timeval _timeout; // a timeout when waiting for data to read from backend protected: bool recvbackend_data(bpContext *ctx, char *buf, int32_t nbytes);