changeset 16139:e4bb630139e4

mktempd: silence dd usage When running a testsuite on FreeBSD, I saw a lot of: 1+ records in 0+1 records out 10 bytes transferred in 0.000063 secs (158875 bytes/sec) literring the testsuite, and traced it to the fact that we were silencing one, but not the other, dd usage in our fallback. * build-aux/mktempd (rand_bytes): Silence dd. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Thu, 01 Dec 2011 13:58:28 -0700
parents f4f0fa456790
children 7fae013a2fd6
files ChangeLog build-aux/mktempd
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-01  Eric Blake  <eblake@redhat.com>
+
+	mktempd: silence dd usage
+	* build-aux/mktempd (rand_bytes): Silence dd.
+
 2011-11-30  Simon Josefsson  <simon@josefsson.org>
 
 	manywarnings: Don't mention gcc version in docstring.
--- a/build-aux/mktempd
+++ b/build-aux/mktempd
@@ -44,7 +44,8 @@
   dev_rand=/dev/urandom
   if test -r "$dev_rand"; then
     # Note: 256-length($chars) == 194; 3 copies of $chars is 186 + 8 = 194.
-    dd ibs=$n count=1 if="$dev_rand" | tr -c $chars 01234567$chars$chars$chars
+    dd ibs=$n count=1 if="$dev_rand" 2>/dev/null \
+      | tr -c $chars 01234567$chars$chars$chars
     return
   fi