Fix C error and OPEN_MAX variable