lkml.org 
[lkml]   [2018]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[for-next][PATCH 18/23] ktest.pl: No need to print no mailer is specified when mailto is not
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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 | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 30a4c053f98b..07d0a47816e4 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -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"
}
}

--
2.16.3

\
 
 \ /
  Last update: 2018-04-08 22:21    [W:0.084 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site