]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
pluginlib: Update ptcomm.
authorRadosław Korzeniewski <radoslaw@korzeniewski.net>
Tue, 24 Nov 2020 18:14:24 +0000 (19:14 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:59 +0000 (09:02 +0100)
bacula/src/plugins/fd/pluginlib/pluginlib.cpp
bacula/src/plugins/fd/pluginlib/ptcomm.cpp
bacula/src/plugins/fd/pluginlib/ptcomm.h

index 599502bb9d3732267999b0d3a5c421f2dbb2562e..64ec05a5f52f3635ea2c2553caeb5273e54c5285 100644 (file)
@@ -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
  */
index 943555eed2c9f2d4c52093a26a6103759c820e82..b2094fe7932a4f53edc61a204bba91e25401d05e 100644 (file)
@@ -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;
index 515c68093bd8865a29ba1a66436b643046a22d3e..b9197d60b8e4bc134b9697483d11a4d9e6ddf0ae 100644 (file)
@@ -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);