NDEVICES
for (h = 0; h < NDEVICES && p->handler == NULL; h++)
if (h == NDEVICES) {
for (h = 0; h < NDEVICES && p->handler == NULL; h++)
for (n = 0; n < NDEVICES; n++)
for (h = 0; h < NDEVICES && p->handler == NULL && p->fd >= 0; h++)