change devname(3) to return NULL on error