This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] scripts/ Verify there is input (don't hang).

If you have a failed build, and run `make check` it could hang forever
in because the awk script waits reading stdin
if the input shell glob expands to nothing (missing input).

We have three options, close stdin, more awk to detect missing input
or more shell. I chose the latter, but we could probably fix this with
`exec 0>&-` in the shell if anyone objects to using find/grep or more

Tested on x86_64 with a broken build directory.

OK to checkin?

2014-12-10  Carlos O'Donell  <>

	* scripts/ Verify there is input.

diff --git a/scripts/ b/scripts/
index 9bffed3..5404e4b 100755
--- a/scripts/
+++ b/scripts/
@@ -25,6 +25,13 @@ cd "$objpfx"
 # OK if *.os is missing.
 shopt -s nullglob
+# Don't hang in awk reading stdin if there is no input to the test.
+# The most likely cause of this failure is a build failure.
+if ! find . -regex '.*\.o[sS]*\.d' | grep -q '.*\.o[sS]*\.d'; then
+    echo "FAIL: No input files to read."
+    exit 1
 # Search all dependency files for file names in the include directory.
 # There are a few system headers we are known to use.
 # These include Linux kernel headers (asm*, arch, and linux),

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]