A more complete patch that fixes all opendir(3) calls.