]> git.sur5r.net Git - bacula/bacula/commitdiff
Display email command on error
authorKern Sibbald <kern@sibbald.com>
Mon, 19 Aug 2002 13:06:26 +0000 (13:06 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 19 Aug 2002 13:06:26 +0000 (13:06 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@104 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/message.c

index 3b5e59b1a69d50245dd1dbca30cdea30a65d7988..93019a31c63190005f322a962b11dd56a60ccefa 100755 (executable)
@@ -499,7 +499,8 @@ void close_msg(void *vjcr)
             * kaboom.
             */
            if (stat < 0 && msgs != daemon_msgs) {
-               Emsg0(M_ERROR, 0, _("Mail program terminated in error.\n"));
+               Emsg1(M_ERROR, 0, _("Mail program terminated in error.\nCMD=%s\n"),
+                 cmd);
            }
            free_memory(line);
 rem_temp_file:
@@ -636,7 +637,6 @@ void dispatch_message(void *vjcr, int type, int level, char *msg)
                 Dmsg1(200, "OPERATOR for following err: %s\n", msg);
                mcmd = get_pool_memory(PM_MESSAGE);
                d->fd = open_mail_pipe(jcr, &mcmd, d);
-               free_pool_memory(mcmd);
                if (d->fd) {
                   int stat;
                   fputs(msg, d->fd);
@@ -644,9 +644,11 @@ void dispatch_message(void *vjcr, int type, int level, char *msg)
                   stat = pclose(d->fd);
                   d->fd = NULL;
                   if (stat < 0) {
-                      Emsg0(M_ERROR, 0, _("Operator mail program terminated in error.\n"));
+                      Emsg1(M_ERROR, 0, _("Operator mail program terminated in error.\nCMD=%s\n"),
+                        mcmd);
                   }
                }
+               free_pool_memory(mcmd);
                break;
             case MD_MAIL:
             case MD_MAIL_ON_ERROR: