From: Jaromir Capik <jcapik@redhat.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] Avoiding warnings when piping to sensors-detect
Date: Thu, 25 Jul 2013 16:49:51 +0000 [thread overview]
Message-ID: <699701256.6909990.1374770991358.JavaMail.root@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 621 bytes --]
Hello.
The attached patch fixes <STDIN> handling when the user
input is taken from /dev/null.
I know this way of generating the config is undocumented
and therefore unsupported, but it seems people use it
that way as the script doesn't support running in
batch mode.
The patch was created for 3.3.4, but can be directly
applied on the latest sources too.
Please, merge the fix.
Thanks in advance.
Regards,
Jaromir.
--
Jaromir Capik
Red Hat Czech, s.r.o.
Software Engineer / BaseOS
Email: jcapik@redhat.com
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkynova 99/71, 612 45, Brno, Czech Republic
IC: 27690016
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: lm_sensors-3.3.4-sensors-detect-null-input.patch --]
[-- Type: text/x-patch; name=lm_sensors-3.3.4-sensors-detect-null-input.patch, Size: 1307 bytes --]
diff -Naur lm_sensors-3.3.4.orig/prog/detect/sensors-detect lm_sensors-3.3.4/prog/detect/sensors-detect
--- lm_sensors-3.3.4.orig/prog/detect/sensors-detect 2013-05-20 21:25:22.000000000 +0200
+++ lm_sensors-3.3.4/prog/detect/sensors-detect 2013-07-25 18:24:41.636807410 +0200
@@ -3707,7 +3707,7 @@
"Do you want to scan it? (\%s/selectively): ",
$default ? "YES/no" : "yes/NO";
- $input = <STDIN>;
+ $input = <STDIN> || '';
if ($input =~ /^\s*n/i
|| (!$default && $input !~ /^\s*[ys]/i)) {
print "\n";
@@ -3718,7 +3718,7 @@
print "Please enter one or more addresses not to scan. Separate them with commas.\n",
"You can specify a range by using dashes. Example: 0x58-0x5f,0x69.\n",
"Addresses: ";
- $input = <STDIN>;
+ $input = <STDIN> || '';
chomp($input);
@not_to_scan = parse_not_to_scan(0x03, 0x77, $input);
} elsif (($class & 0xff00) == 0x0300) {
@@ -6859,7 +6859,7 @@
"safe though. Yes, you do have ISA I/O ports even if you do not have any\n".
"ISA slots! Do you want to scan the ISA I/O ports? (\%s): ",
$superio_features ? "yes/NO" : "YES/no";
- $input = <STDIN>;
+ $input = <STDIN> || '';
unless ($input =~ /^\s*n/i
|| ($superio_features && $input !~ /^\s*y/i)) {
if (initialize_ioports()) {
[-- Attachment #3: Type: text/plain, Size: 153 bytes --]
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2013-07-25 16:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 16:49 Jaromir Capik [this message]
2013-07-25 18:45 ` [lm-sensors] [PATCH] Avoiding warnings when piping to sensors-detect Jean Delvare
2013-07-26 10:01 ` Jaromir Capik
2013-07-26 12:58 ` Jean Delvare
2013-07-26 14:31 ` Jaromir Capik
2013-07-28 12:17 ` Jean Delvare
2013-07-30 17:50 ` Jaromir Capik
2013-09-11 11:47 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=699701256.6909990.1374770991358.JavaMail.root@redhat.com \
--to=jcapik@redhat.com \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.