]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ktest.pl: No need to print no mailer is specified when mailto is not
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 6 Apr 2018 19:49:43 +0000 (15:49 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 6 Apr 2018 20:32:51 +0000 (16:32 -0400)
If the user doesn't want to send mail, then don't bother them with output
that says they didn't specify a mailer. That can be annoying.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index 30a4c053f98b44bd33a14137864704d8a180eaee..07d0a47816e40105adad63dcd4b68fd4adfec5ee 100755 (executable)
@@ -4135,12 +4135,14 @@ sub _sendmail_send {
 }
 
 sub send_email {
-    if (defined($mailto) && defined($mailer)) {
+    if (defined($mailto)) {
+       if (!defined($mailer)) {
+           doprint "No email sent: email or mailer not specified in config.\n";
+           return;
+       }
         if ($mailer eq "mail" || $mailer eq "mailx"){ _mailx_send(@_);}
         elsif ($mailer eq "sendmail" ) { _sendmail_send(@_);}
         else { doprint "\nYour mailer: $mailer is not supported.\n" }
-    } else {
-        print "No email sent: email or mailer not specified in config.\n"
     }
 }