rem: if (dir == NULL);
add: if (dir == NULL)
context: recurse_directory(const char *path, const char *searchedName){	status_t status;	DIR *dir = opendir(path);	if (dir == NULL);		return errno;	errno = 0;	// loop until we have a match or we run out of entries	while (true) {		struct dirent *dirent;		struct stat st;		char *newPath;		size_t size = 0;		TRACE(("scanning %s\n", path));		dirent = readdir(dir);		if (dirent == NULL) {			// we tell the upper layer we couldn't find anything in here			status = errno == 0 ? B_ENTRY_NOT_FOUND : errno;			goto exit;		}		size = strlen(path) + strlen(dirent->d_name) + 2;			newPath = (char *)malloc(size);		if (newPath == NULL) {			status = B_NO_MEMORY;			goto exit;		}		strlcpy(newPath, path, size);		strlcat(newPath, "/", size);			// two slashes wouldn't hurt		strlcat(newPath, dirent->d_name, size);		if (stat(newPath, &st) != 0) {			free(newPath);			errno = 0;			// If we couldn't stat the current file, we will just ignore it;			// it's a problem of the file system, not ours.			continue;		}		if (S_ISREG(st.st_mode)) {			// if it's a file, check if we already have it in the hash table,			// because then we know it doesn't contain the module we are			// searching for (we are here because it couldn't be found in			// the first place)			if (hash_lookup(gModuleImagesHash, newPath) != NULL)				continue;			status = check_module_image(newPath, searchedName);		} else if (S_ISDIR(st.st_mode))			status = recurse_directory(newPath, searchedName);		else			status = B_ERROR;		if (status == B_OK)			goto exit;		free(newPath);	}exit:	closedir(dir);	return status;}