view tools/check/check_hotplug @ 7238:971e7c7411b3

Raise an exception if an error appears on the pipes to our children, and make
sure that the child's pipes are closed even under that exception. Move the
handling of POLLHUP to the end of the loop, so that we guarantee to read any
remaining data from the child if POLLHUP and POLLIN appear at the same time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Thu Oct 06 10:13:11 2005 +0100 (2005-10-06)
parents ef9591d03fdd
children 93e27f7ca8a8 61b3b357d827 409cea2432fc
line source
1 #!/bin/bash
4 function error {
5 echo
6 echo ' *** Check for the hotplug scripts (hotplug) FAILED'
7 exit 1
8 }
10 which hotplug 1>/dev/null 2>&1 || error