constant time checking for open devices
get rid of a magic number (null device)