コード例 #1
0
ファイル: close.c プロジェクト: vormetriclabs/samba
NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
		    enum file_close_type close_type)
{
	NTSTATUS status;
	struct files_struct *base_fsp = fsp->base_fsp;

	if(fsp->is_directory) {
		status = close_directory(req, fsp, close_type);
	} else if (fsp->fake_file_handle != NULL) {
		status = close_fake_file(req, fsp);
	} else {
		status = close_normal_file(req, fsp, close_type);
	}

	if ((base_fsp != NULL) && (close_type != SHUTDOWN_CLOSE)) {

		/*
		 * fsp was a stream, the base fsp can't be a stream as well
		 *
		 * For SHUTDOWN_CLOSE this is not possible here, because
		 * SHUTDOWN_CLOSE only happens from files.c which walks the
		 * complete list of files. If we mess with more than one fsp
		 * those loops will become confused.
		 */

		SMB_ASSERT(base_fsp->base_fsp == NULL);
		close_file(req, base_fsp, close_type);
	}

	return status;
}
コード例 #2
0
ファイル: close.c プロジェクト: WiseMan787/ralink_sdk
NTSTATUS close_file(files_struct *fsp, enum file_close_type close_type)
{
	if(fsp->is_directory) {
		return close_directory(fsp, close_type);
	} else if (fsp->is_stat) {
		return close_stat(fsp);
	} else if (fsp->fake_file_handle != NULL) {
		return close_fake_file(fsp);
	}
	return close_normal_file(fsp, close_type);
}